Getting the date from my left footer

S

Still_learning

Hi,
I’m trying to get the date from my left footer. The date in the footer will
change over time.
In the footer it looks like this.
testBook.xls
Revised 7/30/2009
I’m using this code to get the information, but now I need a way to either
put the last part of this string (the date) or something else that will get
me there.
textString = .LeftFooter
This is the line I used to get "&8&Fï¡ï€ Revised 7/30/2009â€. (The square means
return.)
I’m using office 2003.
 
K

ker_01

I believe that the revision date in the footer comes from:

ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")

That is a date/time field, so you can format it according to how you want to
use it (just date, etc)

HTH,
Keith
 
S

Still_learning

Hi, Ker_01
Getting the revision date is not the problem. The date in the left foot is
not automatically updated with the revision date. So, I’m trying to make a
trigger that will fire when saving or closing that will get the date from the
left footer and then compare it with the BuiltinDocumentProperties("Last Save
Time"). If no change than do nothing if different then update the left footer
with the BuiltinDocumentProperties("Last Save Time").
 
S

Still_learning

Here what my code or the top part of my code look like.

Sub testFooter()
Dim textString
Dim dateString
Dim testWord1
Dim testWord2
Dim testWord3
Dim fsMain
Dim fsFile
Dim revisedDate As Date
Dim upDate


Set fsMain = CreateObject("Scripting.FileSystemObject")
Set fsFile = fsMain.GetFile(ActiveWorkbook.Path & "\" &
ActiveWorkbook.Name)

With ActiveWorkbook.ActiveSheet
revisedDate = Format(CDate(fsFile.DateLastModified), "m/dd/yyyy")
End With

' "&8&F" & Chr(10) & "Revised " & revisedDate

testWord1 = Chr(10) & "SOA INTERNAL USE ONLY"
testWord2 = Chr(10) & "CONFIDENTIAL"
testWord3 = Chr(10) & "PUBLIC"

With ActiveSheet.PageSetup
textString = .LeftFooter

If textString = "&8&F" & Chr(10) & "Revised " & revisedDate Then
upDate = "stop"
Else
upDate = "go"
End If

I found that this will work but i'm still building on it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top