Visio Guy

Visio Discussions => Visio 2013 Issues => Topic started by: JleruOHeP on March 27, 2013, 01:16:22 PM

Title: How to save in vsd format?
Post by: JleruOHeP on March 27, 2013, 01:16:22 PM
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...
Title: Re: How to save in vsd format?
Post by: IRDC on March 28, 2013, 02:49:08 PM
That's very strange. I just saved a vsd file via code like this: Document.SaveAs("C:\\a.vsd");
Title: Re: How to save in vsd format?
Post by: JleruOHeP on March 29, 2013, 10:57:24 AM
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...
Title: Re: How to save in vsd format?
Post by: JleruOHeP on March 29, 2013, 01:14:24 PM
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?
Title: Re: How to save in vsd format?
Post by: Paul Herber on March 29, 2013, 01:25:43 PM
In Visio 2013 there is a setting that stops old file versions (i.e. .vsd) being read. Is this the reason?
Title: Re: How to save in vsd format?
Post by: JleruOHeP on March 29, 2013, 01:43:57 PM
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.