Shapes.AddPicture - How do I add a picture to page two

P

Phil

Hello,

I am trying to insert a picture into a six page document.
I can do this easily enough on page one but I cannot find
insert it on any other page ie page two.

Any help on this would be great,
Thanks in advance,
Phil.
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Phil,

Word does not have a very strong concept of the term page as pagination of
the document can vary depending upon the active printer.

The best thing to do is insert a bookmark where you want the picture to be
inserted and use


ActiveDocument.Bookmarks("bookmarkname").Range.InlineShapes.AddPicture
"PictureFileName"


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
P

Peter Hewett

Hi Phil

Try this:

Public Sub AddPicture()
Dim rngInsert As Word.Range
Dim ilsNew As Word.InlineShape

' Inserting an InlineShape will not automatically replace the selection
Set rngInsert = Selection.Range
rngInsert.Delete
Set ilsNew = Selection.InlineShapes.AddPicture("C:\bath.jpg", _
False, True, rngInsert)
End Sub

Inserts a picture at the current insertion point, or replaces the selection
with a picture.

HTH + Cheers - Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top