Change the footer in a text document with VBA / Macro code

How can I change the footer information in a text document using VBA?

When the document is loaded, the VBA code will get the necessary information from the database, and I want to attach this information to the footer.

I got the information retrieved from the database, but attaching it to the footer is another story.

Any simple examples are appreciated.

+4
source share
1 answer

This will create a header and footer on each page.

With ActiveDocument.Sections(1) .Headers(wdHeaderFooterPrimary).Range.Text = "Header goes here" .Footers(wdHeaderFooterPrimary).Range.Text = "Footer goes here" End With 

You can find more information on how to use headers and footers with vba here: http://msdn.microsoft.com/en-us/library/office/aa221968%28v=office.11%29.aspx

+6
source

All Articles