Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Images to MS Word Doc 1

Status
Not open for further replies.

reffek

Programmer
Apr 7, 2005
24
0
0
US
When creating a Word Document using:

Imports Word = Microsoft.Office.Interop.Word
Dim reportWord As New Word.Application
Dim reportDoc As Word.Document

How do I insert an image? That is, how do I do the VB.NET equivalent of going into Word and doing an "Insert->Picture->From File"?

Adding text and text formatting is easy enough, but I cannot seem to find documentation on adding images to the document.

 
Just start Word and create a macro to insert a given picture.

Then copy the code from the macro into your application and with some little adjustments, you should be able to achieve your goal.

Hope this helps.
 
Thanks! I never considered that. :)

Looks like this is what I need:

myParagraph.Range.InlineShapes.AddPicture("c:\picture.bmp", False, True)
 
Why bother if Microsoft can get the job done for you ! :)

Glad I could help you out!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top