3

I want to extract information from a Visio file and do some change on them(like using C++), then write them back?

My question is:

Is manipulating visio files(mainly reading and writing) programmingly possible?

If so, any tutorial lin is preferred

Cœur
  • 37,241
  • 25
  • 195
  • 267
xiaohan2012
  • 9,870
  • 23
  • 67
  • 101
  • 1
    You can check this http://msdn.microsoft.com/en-us/library/aa201822(v=office.10).aspx – Robby Shaw Sep 22 '11 at 09:50
  • Is your application supposed to work stand-alone or can Visio be used as ActiveX/COM object? – Robert Sep 22 '11 at 09:50
  • @Robert, I have no idea right now. Visio and windows development is so new to me and I have weak ideas about even the basic ideas. Sorry that I am unable to answer this question. – xiaohan2012 Sep 22 '11 at 10:28
  • @xiaohan2012: Then you should possibly update your question with a detailed description what you want to achieve. – Robert Sep 22 '11 at 10:54

1 Answers1

1

Reading/Writing Visio VSD Files This is a binary format and as far as I know, it is not documented. However, check out what has been going with support for reading Visio VSD files in LibreOffice.

Reading/Writing Visio VDX files These are just the XML equivalent of VSD files and relatively straightforward to read and write if you are familiar with Visio. For simple tasks such as finding and manipulating all shape custom properties or formatting it will be very straightforward to load the XML into a DOM, process it, and then save it back out. For example, I once wrote a small tool that used this technique to search and replace text in a set of VDX files. One warning: the more complex a task you want to perform, the more you will need to be very familiar with Visio and how it works with Shapesheets, etc.

Here's a link to get started: http://msdn.microsoft.com/en-us/library/aa218409(v=office.10).aspx

DLRdave
  • 13,876
  • 4
  • 53
  • 70
saveenr
  • 8,439
  • 3
  • 19
  • 20