|
-
Sep 3rd, 2010, 02:41 PM
#1
Thread Starter
Member
[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
-
Sep 3rd, 2010, 07:38 PM
#2
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 4th, 2010, 06:47 AM
#3
Thread Starter
Member
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
-
Sep 4th, 2010, 07:55 AM
#4
Thread Starter
Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|