5

How can I convert Visio binary file (.vsd extension) to Visio xml file(.vdx extension) in programming?

Does Microsoft provide such C/C++ library ?

xiaohan2012
  • 9,870
  • 23
  • 67
  • 101

1 Answers1

11

Option 1: Use Visio application programmatically

Any .NET language can control Visio through it's COM automation interfaces and use its SaveAs method.

$visio = New-Object -ComObject Visio.InvisibleApp;
$visio.Documents.Open(".\Drawing.vsd");
$visio.Documents.SaveAs(".\Drawing.vdx");
$visio.Quit();

SaveAs method on MSDN

This option, obviously requires the Visio application to be installed.

Option 2: Use a third party library

I've never used it but apparently Aspose.Diagram for .NET can be used to convert these files.

Microsoft Library?

To answer your last question: No, Microsoft does not provide a C/C++ library to perform this conversion.

Daniel Fisher lennybacon
  • 3,865
  • 1
  • 30
  • 38
saveenr
  • 8,439
  • 3
  • 19
  • 20
  • 1
    Microsoft only provides the COM Automation interfaces (Option 1). Besides, that there are no libraries of any kind offered. In terms of documentation, the VSD file is a binary format that is not documented, the VDX file format is documented on MSDN. – saveenr Sep 26 '11 at 04:18
  • Option 1 does not work with Visio 2013 as support for saving this format [was removed](https://technet.microsoft.com/en-us/library/cc178954(v=office.15).aspx) – xmojmr Feb 01 '15 at 08:48
  • 1
    While it is true that Save As .vdx is not supported by Visio 2013, and it is true that the question specifically mentions converting .vsd to .vdx, some reading this question/answer may not specifically require .vdx. Visio 2013 does support Save As .vsdx, and it is also an XML format per information found [here](https://technet.microsoft.com/en-us/library/cc178954(v=office.15)). – kbulgrien Sep 14 '16 at 21:04
  • Visio 2021 Saves the file, but the saved data seems to be a vsd - I'm receiving an error the XML is not valid. – Daniel Fisher lennybacon Jun 27 '22 at 13:38