L
Lars
Hi all,
I try to implement the following very simple steps by
automation using VC++:
1. Start MS Visio 2000
2. Open a csv or txt-file
3. Save the file as a Visio drawing (vsd)
4. Exit Visio
....during I perform these steps manually there were
absolutly no problems. Even if I opened a vsd-file via
automation there were no problems at all. But every time I
try to open a csv-file by automation, I get a
COleException from Visio and I will not be able to save
the file or perform any other automation-steps. I will be
very glad if anybody could help me in this case. Please
have a look on my source-code below which works fine for
opening vsd-files:
void CVisioAutomationDlg::OnButton1()
{
IVApplication app;
IVDocuments docs;
IVDocument doc;
if (app.CreateDispatch("Visio.Application"))
{
docs = app.GetDocuments();
if (docs)
{
doc = docs.Open("D:\\My Data\\Data\\Ablauf.csv");
// doc = docs.Open("D:\\My Data\\Data\\Ablauf.vsd");
doc.SaveAs("D:\\My Data\\Data\\Ablauf_neu.vsd");
app.Quit();
}
}
}
Thanks a lot
Regards, Lars
I try to implement the following very simple steps by
automation using VC++:
1. Start MS Visio 2000
2. Open a csv or txt-file
3. Save the file as a Visio drawing (vsd)
4. Exit Visio
....during I perform these steps manually there were
absolutly no problems. Even if I opened a vsd-file via
automation there were no problems at all. But every time I
try to open a csv-file by automation, I get a
COleException from Visio and I will not be able to save
the file or perform any other automation-steps. I will be
very glad if anybody could help me in this case. Please
have a look on my source-code below which works fine for
opening vsd-files:
void CVisioAutomationDlg::OnButton1()
{
IVApplication app;
IVDocuments docs;
IVDocument doc;
if (app.CreateDispatch("Visio.Application"))
{
docs = app.GetDocuments();
if (docs)
{
doc = docs.Open("D:\\My Data\\Data\\Ablauf.csv");
// doc = docs.Open("D:\\My Data\\Data\\Ablauf.vsd");
doc.SaveAs("D:\\My Data\\Data\\Ablauf_neu.vsd");
app.Quit();
}
}
}
Thanks a lot
Regards, Lars