none
Modifying an existing Visio document programatically or with scripts? RRS feed

  • Question

  • I'm not sure if this is even possible, but can someone just point me in the right direction as to what I should start googling.

    I have an existing Visio of some Cisco Switches and their connected servers.

     Is there a way to programmatically modify the existing Visio document. Since it is an existing document I know I have to find out all the objects and properities of the drawing, but how do I go about even starting off with that. I have a copy of Visual Studio but just wanted to see if this was even possible and if anyone has any links I can start off with.

     

    Thanks

    Wednesday, November 16, 2011 8:03 PM

Answers

All replies

  • Hi Eegor,

    Thank you for posting.

    It is possible to automate Visio in a C# application by modifying the existing Visio document via Visio Object Model. You can download the sample code named CSAutomateVisio from the OneCode website:

    http://1code.codeplex.com/wikipage?title=Office

    And here is the MSDN article for you to reference:

    http://msdn.microsoft.com/en-us/library/cc160743(v=vs.90).aspx

    Hope this can help you and just feel free to follow up after you have tried.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Bruce Song Friday, November 25, 2011 1:36 PM
    Monday, November 21, 2011 4:48 AM
  • The first question of course would be to understand what release/version of Visio are you using. :-)

    The Visio SDK is the first place to start. I'd get the v2010 SDK because it has VBA examples and that is a great way to sandbox a beginning solution. Both Chris Roth (www.visguy.com) and John Marshall (visio.mvps.org) have lists of documents and sample code to play with.

    Al


    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Al Edlund Visio MVP
    Monday, December 5, 2011 2:33 PM