Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 604
  • Last Modified:

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
0
sunilramu
Asked:
sunilramu
  • 3
  • 2
1 Solution
 
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:
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
 
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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now