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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
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
All Courses

From novice to tech pro — start learning today.