Export Muli-Page Visio

A

Aleks A

I have the following C# code:

public void SaveFile(string infile, string
outfile)
{
Application app = new Application
();

app.Documents.Open(infile);
app.ActiveWindow.PageAsObj.Export
(outfile);
app.ActiveWindow.Close();
app.Quit();
}

It works fine for single page Visio docs, but it would not
export all of the pages in a multi-page document. How
would I set this up? Do I have to iterate through the
pages collection, and if so, how would I be able to
achieve this?
 
C

Chris Roth [ Visio MVP ]

You can change the pages via the Window object:

Visio.ActiveWindow.Page = "Page-1"

Of course you can get all the page names via Document.Pages.item(...)

--

Hope this helps,

Chris Roth
Visio MVP
 
A

Aleks A.

Thanks for the response, Chris. I figured out another way to export visio
doc as HTML:

public void SaveFile(string infile, string outfile)
{
Application app = new Application();

app.Documents.Open(infile);
app.Addons.get_ItemU("SaveAsWeb").Run("/quiet=True /target=\"" + outfile +
"\"");
app.Quit();
}

Via SaveAsWeb plugin; this will export all the pages by default.
 

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