Question : insert image via bookmark

Hey!

I'm trying to insert a picture at a certain position into a Word document via BookMark.

object oImg = "img1";           
object oBookMark = Word.WdGoToItem.wdGoToBookmark;
wordApp.ActiveDocument.GoTo(ref oBookMark, ref oMissing,ref oMissing, ref oImg);                        //line3
wordApp.ActiveDocument.InlineShapes.AddPicture(slika, ref oMissing, ref oMissing, ref oMissing);     //line4

Line 3 doesn't seem to work.

I'll appreciate any help!

[m]

Answer : insert image via bookmark

Try it like this:

Dim rng As Word.Range

Set rng = wdApp.ActiveDocument.Bookmarks("Mybookmark").Range

wdApp.ActiveDocument.InlineShapes.AddPicture "MyPicture.jpg", False, False, rng
Random Solutions  
 
programming4us programming4us