Asa,
Thanks for the response. Right now, the picture is referenced not by a
bookmark, but by an object. In your sample snippet, the object
reference is missing. I would have to insert a bookmark where I want
the graphic... Right now, the guy who edits the templates knows exactly
where the graphic will go based on the geometry of the picture box
(empty though it is). While this is an alternative we may have to
pursue, I managed to get it to work by adding
.ZOrder msoSendToBack
before the last .ZOrder command.
WHY this would make any difference at all is beyond me... but hey, it
consistently works, so it'll do. Until it screws up again. :)
Best,
Michael
?sa Holmgren - 14 Dec 2004 15:52 GMT
Michael,
nice to hear that the solution works!
You could set the achor of the new shape to the range of the
"TitlePageGraphic" shape, like this:
<--snipp-->
Set r = g_doc.Shapes("TitlePageGraphic").Anchor
Set shp = g_doc.Shapes.AddPicture( _
FileName:="C:\Bilder&ljud\Jpeg\Love.jpg", _
LinkToFile:=False, Anchor:=r)
<--snipp-->
If the graphic is to be on the documents first page you don't have to
specify an anchor when you are using wdRelativeXxxPage.
It is the following code that tells the size and position of the inserted
graphic,
not the size and position of the "TitlePageGraphic" shape:
<--snipp-->
With shp
.Height = InchesToPoints(10.5)
.Width = InchesToPoints(8#)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
.Top = InchesToPoints(0.25)
.Left = InchesToPoints(0.25)
End With
<--snipp-->
/?sa
> Asa,
>
[quoted text clipped - 14 lines]
> Best,
> Michael
Asa,
Thanks for the response. Right now, the picture is referenced not by a
bookmark, but by an object. In your sample snippet, the object
reference is missing. I would have to insert a bookmark where I want
the graphic... Right now, the guy who edits the templates knows exactly
where the graphic will go based on the geometry of the picture box
(empty though it is). While this is an alternative we may have to
pursue, I managed to get it to work by adding
.ZOrder msoSendToBack
before the last .ZOrder command.
WHY this would make any difference at all is beyond me... but hey, it
consistently works, so it'll do. Until it screws up again. :)
Best,
Michael