Author Topic: How to save in vsd format?  (Read 8027 times)

0 Members and 1 Guest are viewing this topic.

JleruOHeP

  • Jr. Member
  • **
  • Posts: 37
How to save in vsd format?
« on: March 27, 2013, 08:16:22 AM »
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
Code
visioControl1.Document.SaveAs(filename);

But it works only if filename have vsdx extension...

IRDC

  • Jr. Member
  • **
  • Posts: 50
Re: How to save in vsd format?
« Reply #1 on: March 28, 2013, 09:49:08 AM »
That's very strange. I just saved a vsd file via code like this: Document.SaveAs("C:\\a.vsd");

JleruOHeP

  • Jr. Member
  • **
  • Posts: 37
Re: How to save in vsd format?
« Reply #2 on: March 29, 2013, 05: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...

JleruOHeP

  • Jr. Member
  • **
  • Posts: 37
Re: How to save in vsd format?
« Reply #3 on: March 29, 2013, 08:14:24 AM »
Another observation.
If I save new file with
Code
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3371
    • Paul Herber's website
Re: How to save in vsd format?
« Reply #4 on: March 29, 2013, 08:25:43 AM »
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 and applications for Visio -

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

JleruOHeP

  • Jr. Member
  • **
  • Posts: 37
Re: How to save in vsd format?
« Reply #5 on: March 29, 2013, 08:43:57 AM »
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.