Adding AutoText to all headers and footers

L

LunaSlashSea

Is there a way to add an autotext entry to ALL headers and footers in a
document no matter if there is a different first page or not, or if
there are multiple sections or not?
 
G

Greg Maxey

Perhaps something like:

Sub ScratchMacro()
Dim oDoc As Document
Dim oRng As Word.Range
Dim oSec As Long
Dim i As Long
Set oDoc = ActiveDocument
For oSec = 1 To oDoc.Sections.Count
With oDoc.Sections(oSec)
For i = 1 To 3
With .Headers(i)
.LinkToPrevious = False
.Range.InsertAfter
oDoc.AttachedTemplate.AutoTextEntries("ATTN:")
End With
With .Footers(i)
.LinkToPrevious = False
.Range.InsertAfter
oDoc.AttachedTemplate.AutoTextEntries("ATTN:")
End With
Next i
End With
Next oSec
End Sub
 

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