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

  • Thread starter Thread starter JSL
  • Start date Start date
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
 
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.
 
Back
Top