Automate Visio Export with VB.NET

J

J.R. Brown

I'm working with VS 2003 and Visio 2003, this code seems to work with
Visio 2002. Could it be a bug in 2003?

Steps in code:
1. Create Visio Application
2. Open Visio File
3. Export Visio as GIF format
4. Close Visio

Here is the code in question:

Dim vApp As New Visio.Application
Dim vDoc As Visio.Document
Dim vPage As Visio.Page

vDoc = vApp.Documents.Add("c:\test.vsd")
vPage = vDoc.Pages(1)
vPage.Export("c:\test.gif")
vApp.Quit()
vDoc = Nothing
vApp = Nothing
GC.Collect()

Simple eh? I can't imagine what is going on here. The part that really
bakes my noodle is that this code works in VBA running inside of
Visio. Thanks for any suggestions!

J.R.

PS. I'm using the latest PIA.
 
L

Lars79

Hi J.R.

I'm sorry but I can't help you but maybe you can help me ;-) I need an
equivalent functionality for Visual C++:

1. Create Visio Application
2. Import .csv-file
3. Save the file as .vsd
4. Close Visio

Do you have any idea for implementing this in VC?

Regards,

Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top