[Visio] Retrieving Shape Object Data
Hello Everyone,
I am trying to write a simple VB .net application to read the properties of all my shapes in my visio file and display them all in a text box.
I need to create a Visio.Application object, set it to my file path, connect to the visio document, and pull back a collection of shape objects, and iterate through them.
As a newbe to office development, can anyone suggest anywhere I could begin?
Perhaps a tutorial that explains how to read shape objects?
Thanks a lot
jumax
Re: [Visio] Retrieving Shape Object Data
i have never used visio,
in excel you can do like
vb Code:
for each s in activesheet.shapes
msgbox s.name 'whatever property you want to display
next
check out the office automation tutorial in the FAQ thread at the top of this forum
Re: [Visio] Retrieving Shape Object Data
OK thanks a lot for that. Sadly I'm not doing very well at all.
I have done some more reading, and I understand that it is neccesary to add a reference to an automation library so I have added the library
"Microsoft Visio 12.0 Type Library"
I have also installed the Primary Interop Assemblies and installed the DLLs correctly
(download here )
I have also defined a visio application object in my code, and attempted to set this object to a new visio application
Code:
Dim visApplication As Visio.Application
visApplication = New Visio.Application()
However I seem to be a long way from my goal as I'm starting to get a problem similar to this one with Visual Studio Express not finding .dlls. This is started to happen after installing Microsoft's "Primary Interop Assemblies".
I tried manually registering the files using the dos prompt but it didn't work - and now I'm having to reinstall studio.
If anyone has any other ideas on getting visio shape properties please let me know
Thanks a lot
Re: [Visio] Retrieving Shape Object Data
I've just started a post for this issue over here as I have spent way too long trying to sort this one out and I'm not getting anywhere at all.
I will post the code for this visio issue as soon when I eventually get it working.
Thanks