How to insert images into a Microsoft Word document using VB.NET??

J

JSL

How to insert images into a Microsoft Word document using VB.NET??

my code:
Public Function PictureReport()

(it doesn't work!!!)
On Error Resume Next
Dim oDoc As Word.Document
Dim range As Word.Range

oDoc = GetObject(strIniFileName)
oDoc.Bookmarks.Item("Pic").Range.InlineShapes.AddPicture(fileName:="C:\temp\Pic\test2.jpg",
LinkToFile:=False, SaveWithDocument:=True) '<- this park doesn't work


'Save Document
oDoc.SaveAs(Filename:=strIniSave & "\" & "outCome2" & ".doc")

'close the word Document, App still open
oDoc.Close()
oDoc = Nothing
Exit Function
ErrorHandle:
MessageBox.Show("Template file missing.")
End Function

thankyou
 
K

Kevin Spencer

Try the microsoft.public.vsnet.vstools.office newsgroup.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

It takes a tough man to make a tender chicken salad.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top