How to insert a file and path name into every footer in a document

N

NeedtoKnow

this should assume that there may be many sections with some sections having a different first page footer attribute.

Any help would be greatly appreciated.
 
J

Jezebel

You can iterate all the footers in a document like this:

Dim pIndex as long
Dim pFooter as range

For pIndex = 1 to 3
set pFooter = Doc.StoryRanges(Choose(pIndex, _
wdEvenPagesFooterStory, _
wdFirstPageFooterStory, _
wdPrimaryFooterStory))

Do until pFooter is nothing
.... do whatever here (eg insert your path/file field)
pFooter.Fields.Add Range:=pFooter, Type:=wdFieldFileName,
Text:="\p"

set pFooter = pFooter.Next
Loop
Next




NeedtoKnow said:
this should assume that there may be many sections with some sections
having a different first page footer attribute.
 

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