Insert picture on a microsoft word document...?

vincehhw

New member
Joined
Dec 16, 2003
Messages
4
Help! Does anyone know how to insert an image(jpeg, gif, bmp) on an existing word document? I manage to insert the picture but it always come out on top of the document. What I want is to place the picture at the bottom of word document... I have been struggling the whole day to get this problem solved... Please enlighten me if you have the solution. Im currently using C#.Net. Its okay if you have the code in VB.Net. Thanks...!
 
Obviously if you are able to add a picture youve got the basic idea of how to interact with word. So basically you need to know how to manipulate a range object.
Just set your range object equal to the Content of the Document object. Insert a Carriage return and linefeed. Then set the start of your range object to its end. You are now ready to add the picture.
Code:
objWdRng = objWdDoc.Content
This line is optional (more for formatting)
objWdRng.InsertAfter vbCrLf
objWdRng.Start = objWdRng.End
objWdRng.InlineShapes.AddPicture "C:\YourFile.jpg"
 
Thank you very much, Wamphyri! I really appreciate your help. The code is working perfectly. Youve made my life much easier... Thanks again...
 
Back
Top