Copy Pictures to Word from VB

srxicey

New member
Joined
Sep 30, 2006
Messages
1
Programming Experience
1-3
Appreciate any help on this.. I'm sure its a really simple line i'm missing but what my code does is copy and image to the clipboard, open a word document, paste the image from the clipboard and then it moves the image to whereever i choose using the IncrementTop method. The problem i'm having is that once it pastes the image it doesn't automatically keep the image selected so the IncrementTop errors out. I can get it working by using objDoc.Shapes.SelectAll, but this causes problems when there is more than one image on the page, because it selects all the images and moves them all. Is there any way to reselect this pasted image? Thx in advance :D

objWord = CreateObject("Word.Application")
objWord.Visible =
True
objDoc = objWord.Documents.Open(FileName)

Clipboard.Clear()
Clipboard.SetImage(Image)

objWord.Selection.PasteSpecial()

objWord.Selection.ShapeRange.IncrementTop(612.0#)


 
Back
Top