B
B.Molsbeck
Hello,
I am developing an addin for Microsoft Visio 2003. One of the functions
of the addin shows a modal dialog with a picturebox. In that picturebox
I need to show a visual representation of a shape of the Visio
document.
I use the following code to retrieve and show the picture:
Dim theDocument As Microsoft.Office.Interop.Visio.Document =
Application.ActiveDocument
For Each thePage As Microsoft.Office.Interop.Visio.Page In
theDocument.Pages
For Each theShape As Microsoft.Office.Interop.Visio.Shape In
thePage.Shapes
Dim thePicture As stdole.IPictureDisp = theShape.Picture
Dim theShapeMetafile As System.Drawing.Imaging.Metafile = _
New System.Drawing.Imaging.Metafile(New IntPtr(thePicture.Handle),
False)
thePictureBox.Image = theShapeMetafile
....
But on the 4th line ("theShape.Picture") I receive the following error:
"Method not found: Microsoft.Office.Interop.Visio.Shape.get_Picture()"
What am I doing wrong? Does anybody know a different way to retrieve
the picture of a shape?
Thanks in advance for your help!
Greetings: Bastiaan Molsbeck ([email protected])
I am developing an addin for Microsoft Visio 2003. One of the functions
of the addin shows a modal dialog with a picturebox. In that picturebox
I need to show a visual representation of a shape of the Visio
document.
I use the following code to retrieve and show the picture:
Dim theDocument As Microsoft.Office.Interop.Visio.Document =
Application.ActiveDocument
For Each thePage As Microsoft.Office.Interop.Visio.Page In
theDocument.Pages
For Each theShape As Microsoft.Office.Interop.Visio.Shape In
thePage.Shapes
Dim thePicture As stdole.IPictureDisp = theShape.Picture
Dim theShapeMetafile As System.Drawing.Imaging.Metafile = _
New System.Drawing.Imaging.Metafile(New IntPtr(thePicture.Handle),
False)
thePictureBox.Image = theShapeMetafile
....
But on the 4th line ("theShape.Picture") I receive the following error:
"Method not found: Microsoft.Office.Interop.Visio.Shape.get_Picture()"
What am I doing wrong? Does anybody know a different way to retrieve
the picture of a shape?
Thanks in advance for your help!
Greetings: Bastiaan Molsbeck ([email protected])