FlorisMK
asked on
Create Header and Footer from VBA
For a macro that converts existing documents to to the new company design, I need to insert header and footer items. I thought it would be easy, like this:
NormalTemplate.AutoTextEnt ries("New Company Header").Insert ActiveDocument.StoryRanges (wdPrimary HeaderStor y), True
However, this line gives a run-time error if the active document doesn't yet have a header. Entering a space into the header by hand solves the problem, but that's not satisfactory, because I want to have the full conversion automated.
I can't find any way in VBA to create header and footer in a document that doesn't yet have them. Anyone?
NormalTemplate.AutoTextEnt
However, this line gives a run-time error if the active document doesn't yet have a header. Entering a space into the header by hand solves the problem, but that's not satisfactory, because I want to have the full conversion automated.
I can't find any way in VBA to create header and footer in a document that doesn't yet have them. Anyone?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.