J
Jean-Guy Marcil
rob was telling us:
rob nous racontait que :
Well, I don't have time right now to code the whole thing for you...
But, in general..
Set a range to the header you want, like:
Dim HeaderRange As Range
Set HeaderRange =
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
Then manipulate the range to get the insertion where you want it, as in:
HeaderRange.Collapse wdCollapseEnd
or you may have done that to some extent before, when setting the range:
Set HeaderRange = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)
_
.Range.Paragraphs(1).Range
HeaderRange.Collapse wdCollapseEnd
And finally, insert the autotext:
With HeaderRange
.Text = "MyAutoTextName"
.InsertAutoText
End With
See the help file for the InsertAutoText method for more information.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
rob nous racontait que :
That would be great Jean,
How do I do that?
Well, I don't have time right now to code the whole thing for you...
But, in general..
Set a range to the header you want, like:
Dim HeaderRange As Range
Set HeaderRange =
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
Then manipulate the range to get the insertion where you want it, as in:
HeaderRange.Collapse wdCollapseEnd
or you may have done that to some extent before, when setting the range:
Set HeaderRange = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)
_
.Range.Paragraphs(1).Range
HeaderRange.Collapse wdCollapseEnd
And finally, insert the autotext:
With HeaderRange
.Text = "MyAutoTextName"
.InsertAutoText
End With
See the help file for the InsertAutoText method for more information.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org