Saving visio file as a webpage

I am looking for VBA code for saving a visio file with multiple pages into a web page.

thanks
sunil
sunilramuAsked:
Who is Participating?
 
Scott HelmersConnect With a Mentor Visio Consultant, Trainer, Author, and DeveloperCommented:
Are you ready for how easy this is??

There are all sort of variations to set path name and other parameters, including using SaveAsEx instead of SaveAs, but the attached code will do the trick. The key is merely to use .htm as the file extension in the save as command.

When the save completes, look for Sample Drawing.htm and pop it into Internet Explorer.
Sub SaveAsWebPage()
 
    Application.ActiveDocument.SaveAs "C:\temp\Sample Drawing.htm"
 
End Sub

Open in new window

0
 
sunilramuAuthor Commented:
i forgot to mention that my visio file might have multiple pages in it.

thanks
0
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
One additional thought regarding my previous posting --

You may already know this if you've played with this function manually, but Visio creates two things when you use Save as Web Page: 1) an index file and 2) a subdirectory that contains all of the pages from your drawing, image files, javascript files, XML files and various other widgets. Using the code snippet from my previous posting:

The index file will be called "Sample Drawing.htm"

The subdirectory will be called "Sample Drawing_files"
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
sunilramuAuthor Commented:
thanks scott,

how do i incorporate this into my vb application (not VBA). thanks
0
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
Not sure I can help you with VB -- you asked for VBA code and that's what I gave you!
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.