Results 1 to 4 of 4

Thread: [Visio] Retrieving Shape Object Data

  1. #1

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    39

    [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

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Visio] Retrieving Shape Object Data

    i have never used visio,
    in excel you can do like
    vb Code:
    1. for each s in activesheet.shapes
    2.     msgbox s.name  'whatever property you want to display
    3. 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

  3. #3

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    39

    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

  4. #4

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    39

    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
  •  



Click Here to Expand Forum to Full Width