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
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