By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 801 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.AddP icture(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

Aug 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
"JSL" <ji*************@yahoo.com.hkwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
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.AddP icture(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

Aug 29 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.