0
Answer

c# visio saveas method

alex Zeilinger

alex Zeilinger

15y
5.4k
1
Hi folks,

first of all, i am a newbie in c#.

I am trying to open a visio-document and simply save it, but it doesn't work and i don't know what the mistake is.

My code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using visio = Microsoft.Office.Interop.Visio;


namespace VisioZeichnen
{
    class Program
    {
        static void Main(string[] args)
        {
            string docPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) + @"Speditionsanlage_Vorlage.vst";
            visio.Application myvisio = new visio.Application();
            myvisio.Documents.Open(docPath);
        

          
            string savePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) + @"Speditionsanalage.vsd";
            myvisio.ActiveDocument.SaveAs(savePath);
             
        }
    }
}

Please help me ;-)

Kind Regards,
r4echer