Hallo,
I am using this code to insert an autotext into the header of a document.
The problem is that I would like to add a second element, but with this code the second would overwrite the first one:
This is quite obvious, since I am using the same range to insert the two elements. But how can I say "insert it after this other element"... Another option would be to define a new range, something like "this range is after that range"...
Does someone has an hint? thanks
I am using this code to insert an autotext into the header of a document.
The problem is that I would like to add a second element, but with this code the second would overwrite the first one:
Code:
Dim rng As Range
Set rng = ActiveDocument.Sections(1).Headers(1).Range
ActiveDocument.AttachedTemplate.AutoTextEntries("HeaderAddress").Insert Where:=rng, RichText:=True
ActiveDocument.AttachedTemplate.AutoTextEntries("HeaderTitle").Insert Where:=rng, RichText:=True
This is quite obvious, since I am using the same range to insert the two elements. But how can I say "insert it after this other element"... Another option would be to define a new range, something like "this range is after that range"...
Does someone has an hint? thanks