zippy221
asked on
Insert Image into Word Document Bookmark
I have a template set up in Microsoft Word. There is a bookmark called IMAGE, and that is where I want to insert an image if one is selected from my VB program. In my VB program I am using a common dialog box to allow people to choose an image and then I have a picture box called picture1 that displays the image, so that a person can see if he/she likes the image before creating the word document with the image in it... the only problem is that I am having trouble inserting the image. I have tried copying it to the clipboard and pasting it in the bookmark, but that didn't seem to work...here is what I have so far:
ElseIf UCase$(lsBookmarkName) = "IMAGE" Then
Clipboard.Clear ' Clear Clipboard.
Clipboard.SetData LoadPicture(Me.CommonDialo g2.FileNam e)
loWord.Bookmarks("IMAGE"). Select
ActiveWindow.ActivePane.Se lection.Pa ste
For some reason it puts whatever is in the next bookmark in the place where I have the IMAGE bookmark...
ElseIf UCase$(lsBookmarkName) = "IMAGE" Then
Clipboard.Clear ' Clear Clipboard.
Clipboard.SetData LoadPicture(Me.CommonDialo
loWord.Bookmarks("IMAGE").
ActiveWindow.ActivePane.Se
For some reason it puts whatever is in the next bookmark in the place where I have the IMAGE bookmark...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER