Special footer in Excel

  • Thread starter Thread starter µ
  • Start date Start date
Μ

µ

At the office we use Lotus Notes 6.5.
In this database we have instructions with excel files attached to
them.
When we open them, the title is generated by Lotus Notes i guess.
The title that appears is something like this:

Document opened as read only - This is the title (revision 3)

Now if i use &[File] as the footer, it shows the whole title like
above.
I only want: This is the title (revision 3)
How can i retrieve only the title and revision number out of Lotus
Notes, OR create a footer from the title, that only shows the part i
need. Without the: "Document opened as read only -"

Is there a way to get &[File], but strip the first part from it?

Any suggestions?
 
Hi µ

Try this workbook event in the workbook code

Option Explicit

Const csz_title_start As String = "Document opened as read only - "

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ls As Integer
Dim s As String
ls = Len(csz_title_start)
s = Workbook.FullName
If (Left(s, ls) = csz_title_start) Then
With ActiveSheet.PageSetup
.CenterFooter = Mid(s, ls + 1, Len(s) - ls)
End With
End If
End Sub

I can't text it so not sure if the s = Workbook.FullName will work if
not try .name instead.

--


Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.
 
Back
Top