Publisher 2007 - Filename and Path in Footer

L

Lisa Wilke-Thissen

Hi all,

as I see, there is no possibility to have filename and path automatically
inserted into the footer. Is it possible using VBA?
 
J

JoAnn Paules

Hi Lisa!

Ed is our Publisher VBA guru. Contact him and see what he can do. I'm lucky
I can spell VBA. ;-)
 
E

Ed Bennett

Lisa said:
as I see, there is no possibility to have filename and path
automatically inserted into the footer. Is it possible using VBA?

Hi Lisa!

This line of code:
ThisDocument.MasterPages(1).Footer.TextRange.InsertAfter
ThisDocument.Path & ThisDocument.Name

will insert the current filename and path into the footer of the first
master page of the publication. This will not update should the document
move, nor will it delete any other path that is already there.

If you preface it with the code

ThisDocument.MasterPages(1).Footer.TextRange.Delete

then the footer will be deleted first, thus avoiding having multiple
paths in the footer (but also wiping out any other custom text you have
there). You could change the first statement to include other text to
compensate for this.

If you put the code in the Document_Open event handler, then you could
make the path update each time the document is opened.
 
L

Lisa Wilke-Thissen

Hi Ed and JoAnn,

thanks for your support :)).

Regards from Germany

Lisa
MVP Word
 

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