News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

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.

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 229 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1103KB.
Tokens: post-login.
Cache hits: 13: 0.00123s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]