Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

Automatic update of footer macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg - 18 Oct 2007 22:29 GMT
I'm posting this for a user who sent me the following query, which I've
inserted below as submitted to me:

"Hi ,

Don't know if you know any VBA but I have a problem that I haven't been able
to resolve.  I don't know any VBA but I can usually cheat by looking
something up via google or recording a macro and transferring and altering
parts of the code to do what I need it to do.  But I haven't been able to
figure this one out:

I have a footer macro that I set up to include the "last author" and "last
modified" items rather than the current date/time and the original author.  
The problem with my footer is that it doesn't update these items
automatically when I save.  It will only update if I re-run the macro to
insert the footer.  (This is the same problem as with using the regular
pathname footer in Excel - which doesn't update when you use save as and save
a file with the pathname in the footer to a new location.)

Sub Footer()
'
' Footer Macro
' Macro recorded 3/26/2007 by atao
'

ActiveSheet.PageSetup.LeftFooter = "&8Last Modified by " & ActiveWorkbook. _
       BuiltinDocumentProperties("last author").Value & " " &
ActiveWorkbook. _
       BuiltinDocumentProperties("last save time") & Chr(10) & "&Z&F\&A"
       
       ActiveSheet.PageSetup.RightFooter = "&8&P of &N"
       
End Sub

So, I am either trying to find a way for those items to auto-update as does
current date and time (when you use &[date] &[time] (which I have a feeling
can't be done for Builtin Document Properties or have the macro re-run
automatically upon saving.  I found something called "OnAction" property that
may do the trick when save is pressed but I actually don't know any VBA so I
thought maybe you would be able to help me?"
Graham Mayor - 19 Oct 2007 07:15 GMT
This forum is for Microsoft Word. Ask your Excel questions in an Excel
forum.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I'm posting this for a user who sent me the following query, which
> I've inserted below as submitted to me:
[quoted text clipped - 40 lines]
> actually don't know any VBA so I thought maybe you would be able to
> help me?"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.