VBA on MS-Word 2000

K

Kaixa

Hi,

I'm trying to add a picture at a bookmark position from template. The add
picture code was listed as follow:

With ActiveDocument.Bookmarks(Bookmark_Name).Range
.InlineShapes.AddPicture filename:=imageName, LinkToFile:=True,
SaveWithDocument:=True
End With

The above code seems to work if only one page was generated from template.
However, if generate a two pages using same template file. the 2nd picture
was loaded but not located on 2nd page bookmark position. It paste on the
near by 1st picture. Why?

Can somebody help me?


Kaixa
 
C

Cindy M -WordMVP-

Hi Kaixa,
I'm trying to add a picture at a bookmark position from template. The add
picture code was listed as follow:

With ActiveDocument.Bookmarks(Bookmark_Name).Range
.InlineShapes.AddPicture filename:=imageName, LinkToFile:=True,
SaveWithDocument:=True
End With

The above code seems to work if only one page was generated from template.
However, if generate a two pages using same template file. the 2nd picture
was loaded but not located on 2nd page bookmark position. It paste on the
near by 1st picture. Why?
Are you sure the name of the second bookmark is ever being specified? How are
you assigning a value to the Bookmark_Name variable? (look for something like
Bookmark_Name = "xyz" where the name of the bookmark would stand in place of
xyz)

It might help if you show us more code, most especially the part that "knows"
to execute the insertion more than once (because you have more than one
page).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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