Solved

Saving visio file as a webpage

Posted on 2007-11-28
7
573 Views
Last Modified: 2008-02-01
I am looking for VBA code for saving a visio file with multiple pages into a web page.

thanks
sunil
0
Comment
Question by:sunilramu
  • 3
  • 2
7 Comments
 

Author Comment

by:sunilramu
ID: 20366050
i forgot to mention that my visio file might have multiple pages in it.

thanks
0
 
LVL 30

Accepted Solution

by:
Scott Helmers earned 500 total points
ID: 20368913
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
 
LVL 30

Expert Comment

by:Scott Helmers
ID: 20369512
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:sunilramu
ID: 20369767
thanks scott,

how do i incorporate this into my vb application (not VBA). thanks
0
 
LVL 30

Expert Comment

by:Scott Helmers
ID: 20370592
Not sure I can help you with VB -- you asked for VBA code and that's what I gave you!
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20658523
Forced accept.

Computer101
EE Admin
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Question Several times in recent years, someone has posted a question at EE asking whether they could display the Windows directory structure – folders and subfolders – using Visio. When one person specifically asked about displaying directory …
Scott A. Helmers Partner, Harvard Computing Group Microsoft Visio MVP Background Microsoft has added more enhancements and new features to Visio 2010 than to any release since they purchased the Visio product line in 2000. In addition, the com…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question