V
voip1234
I am trying to insert AutoText into Headers in my document.
I carefully selected just what is needed to create the
autotext, but when I insert the autotext into the header
it adds an extra paragraph mark (the mirrored 'P').
This cause problems because all my document gets reflowed.
Can somebody please help me figure out how I can either
delete the paragraph marks or have them not be inserted
in there in the first place please?
My current code to insert the autotext is the following
ActiveDocument.AttachedTemplate.AutoTextEntries _ ("myAutoText").Insert
_
Where:=ActiveDocument.Sections(i).Headers _
wdHeaderFooterPrimary).Range, _
RichText:=True
the 'i' is the index for the loop that goes through all
my sections.
I have also tried to add a delete line before that command
but that didnt help either. I used
ActiveDocument.Sections(i).Header _
(wdHeaderFooterPrimary).Range.Delete
I have checked and rechecked and as far as I can see
my autotext (which includes its style) does not have
the extra paragraph marks.
How can I avoid these marks in the first place or
how can I convert the following code to work inside
the ranges?
Selection.EndKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
This would do what I need.
thanks for the help.
I carefully selected just what is needed to create the
autotext, but when I insert the autotext into the header
it adds an extra paragraph mark (the mirrored 'P').
This cause problems because all my document gets reflowed.
Can somebody please help me figure out how I can either
delete the paragraph marks or have them not be inserted
in there in the first place please?
My current code to insert the autotext is the following
ActiveDocument.AttachedTemplate.AutoTextEntries _ ("myAutoText").Insert
_
Where:=ActiveDocument.Sections(i).Headers _
wdHeaderFooterPrimary).Range, _
RichText:=True
the 'i' is the index for the loop that goes through all
my sections.
I have also tried to add a delete line before that command
but that didnt help either. I used
ActiveDocument.Sections(i).Header _
(wdHeaderFooterPrimary).Range.Delete
I have checked and rechecked and as far as I can see
my autotext (which includes its style) does not have
the extra paragraph marks.
How can I avoid these marks in the first place or
how can I convert the following code to work inside
the ranges?
Selection.EndKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
This would do what I need.
thanks for the help.