I have a Visual Basic program which uses Word automation to send database data to form fields in a Word template which is then printed. This part works fine. I now need to insert a linked Visio diagram into the word document using OLE and resize it to a certain size to fit into the template. The filename of the visio diagram is dynamic. This is the code I'm trying to use to do this- I am getting an Error 4198- Command Failed (love those descriptive error messages!) strVisioPath is a variant variable containing the path and file name of the visio file. I have tried it with the shapes and inlineshapes objects.
Any suggestions would be greatly appreciated! Thanks.
Code:
objWordDoc.InlineShapes.AddOLEObject Filename:=strVisioPath, linktofile:=True, DisplayAsIcon:=False, Left:=25, Top:=50, Width:=100, Height:=100
Any suggestions would be greatly appreciated! Thanks.