Re: Graphics insertion

From: Åsa Holmgren (asa)
Date: 12/14/04


Date: Tue, 14 Dec 2004 16:52:01 +0100

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

<mjcnospam-google@yahoo.com> skrev i meddelandet
news:1103032402.698333.41340@c13g2000cwb.googlegroups.com...
> 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
>



Relevant Pages

  • Re: Graphics insertion
    ... reference is missing. ... I would have to insert a bookmark where I want ... where the graphic will go based on the geometry of the picture box ... .ZOrder msoSendToBack ...
    (microsoft.public.word.vba.general)
  • Re: Graphics insertion
    ... reference is missing. ... I would have to insert a bookmark where I want ... where the graphic will go based on the geometry of the picture box ... .ZOrder msoSendToBack ...
    (microsoft.public.word.vba.general)
  • Re: same pict in multiple locations?
    ... In my case I'm embedding ... For future reference, ... Bookmarked the whole picture: ... > bookmark, I find this in the file: ...
    (microsoft.public.win32.programmer.gdi)
  • Re: same pict in multiple locations?
    ... In my case I'm embedding ... For future reference, ... Bookmarked the whole picture: ... > bookmark, I find this in the file: ...
    (microsoft.public.word.drawing.graphics)
  • Re: same pict in multiple locations?
    ... In my case I'm embedding ... For future reference, ... Bookmarked the whole picture: ... > bookmark, I find this in the file: ...
    (microsoft.public.word.conversions)