How to save in vsd format?

Started by JleruOHeP, March 27, 2013, 01:16:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JleruOHeP

Can you tell me, how can I save diagramm in vsd format (not vsdx) using visio 2013 in c# code?
I am trying something like
visioControl1.Document.SaveAs(filename);
But it works only if filename have vsdx extension...

IRDC

That's very strange. I just saved a vsd file via code like this: Document.SaveAs("C:\\a.vsd");

JleruOHeP

Checked once more time. Actually, it saves file with correct format (vsd) and name, but it also throws file not found. I`ve tried to save that file to "C:\1\a.vsd" but nothing changed.
I will try to swallow that exception, but it is not very good solution...

JleruOHeP

Another observation.
If I save new file with
try
{
    visioControl1.Document.SaveAs(***.vsd)
} catch {}

and then try to set visioControl.Src to any value - it throws another exception - HRESULT FAIL with code 80004005. Without saving it works fine...
What should I try?

Paul Herber

In Visio 2013 there is a setting that stops old file versions (i.e. .vsd) being read. Is this the reason?
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

JleruOHeP

No, I dont think so. As if I open old version file first then there is no errors.
The error appears only if I save new file (and when I save that file) and try to open existing one.