A
Arjan
Hi, trying to set the wdWrapSquare property for a picture that I insert from
within an VB application exe.
Error says:'The Object is not valid' (See code line)
So the question is, how can I refer to the picture I have inserted?
Thanx in advance.
Arjan
--Code:
Dim Doc As Word.Document
Dim wordApp As Word.Application
' Create new hidden instance of Word.
Set wordApp = CreateObject("Word.Application")
Set Doc = wordApp.Documents.Open(FileName:="C:\Test.doc")
Doc.Shapes.AddPicture FileName:="C:\test.jpg", LinkToFile:=False,
SaveWithDocument:=True, Left:=30, Top:=50
Doc.Shapes(1).Select
--->> Error on this line: Selection.ShapeRange.WrapFormat.Type =
wdWrapSquare
wordApp.Quit
Set wordApp = Nothing
--EndOfCode
within an VB application exe.
Error says:'The Object is not valid' (See code line)
So the question is, how can I refer to the picture I have inserted?
Thanx in advance.
Arjan
--Code:
Dim Doc As Word.Document
Dim wordApp As Word.Application
' Create new hidden instance of Word.
Set wordApp = CreateObject("Word.Application")
Set Doc = wordApp.Documents.Open(FileName:="C:\Test.doc")
Doc.Shapes.AddPicture FileName:="C:\test.jpg", LinkToFile:=False,
SaveWithDocument:=True, Left:=30, Top:=50
Doc.Shapes(1).Select
--->> Error on this line: Selection.ShapeRange.WrapFormat.Type =
wdWrapSquare
wordApp.Quit
Set wordApp = Nothing
--EndOfCode