Roderick O'Regan was telling us:
Roderick O'Regan nous racontait que :
> The following snippet is part of a larger procedure which places
> AutoText graphics in a header and then moves them to the correct
[quoted text clipped - 33 lines]
>
> Could someone explain why this is happening, please?
Try not to use the ActivePane and Selection.
Instead, try something like this:
'_______________________________________
Dim rgeHeader As Range
Dim shpHeader As Shape
Set rgeHeader =
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
rgeHeader.Collapse wdCollapseStart
'enters the autotext graphic located in the attached Template
ActiveDocument.AttachedTemplate.AutoTextEntries("Test").Insert _
Where:=rgeHeader, RichText:=True
Set rgeHeader = rgeHeader.Sections(1).Headers(wdHeaderFooterPrimary).Range
'rgeHeader.Select
Set shpHeader = rgeHeader.ShapeRange(1)
With shpHeader
.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionPage
.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
.Left = CentimetersToPoints(2.5)
.Top = CentimetersToPoints(1.99)
.WrapFormat.AllowOverlap = True
End With
'_______________________________________

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Roderick O'Regan - 02 Aug 2007 22:43 GMT
Thanks Jean-Guy for the help.
Is your solution then, in this case, to use ranges rather than
selections?
It seems very odd how it works in selection - or doesn't! In one
instance it doesn't recognise the Relative position command and then
it does the second time around. Weird!
Roderick
>Roderick O'Regan was telling us:
>Roderick O'Regan nous racontait que :
[quoted text clipped - 67 lines]
>End With
>'_______________________________________
Jean-Guy Marcil - 03 Aug 2007 02:17 GMT
Roderick O'Regan was telling us:
Roderick O'Regan nous racontait que :
> Thanks Jean-Guy for the help.
>
[quoted text clipped - 4 lines]
> instance it doesn't recognise the Relative position command and then
> it does the second time around. Weird!
I always avoid the Selection object (Except when there are no other choice,
of course), and I especially want to avoid the ActivePane method to access
headers/footers because too often I had problems when doing so.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org