Click Here to Install Silverlight*
United StatesChange|All Microsoft Sites|Windows Live ID
Microsoft
|Communities Home|Communities Worldwide
  Visio Save as Web query in Developer - VBA  
 |  Edit my Profile  |  Help
 
     
  
 
 
 
James Price at Premier 5/22/2009 12:02 AM PST
  Question
  I’m using Visio 2007 VBA to automate Save as Web Page.

Sub saveAsWebPage()
Dim saveAsWeb As VisSaveAsWeb
Dim webSettings As IVisWebPageSettings

Set saveAsWeb = New VisSaveAsWeb
Set webSettings = saveAsWeb.WebPageSettings
Set webSettings = saveAsWeb.WebPageSettings
' Configure the preferences.
webSettings.StartPage = 1
webSettings.EndPage = ThisDocument.Pages.Count - 1
webSettings.LongFileNames = True
webSettings.TargetPath = "c:\WardManDemo.htm"
webSettings.SilentMode = True

saveAsWeb.CreatePages

End Sub

This works fine except that when I re-run the macro the web page (internet
Explorer 7) only updates when I press the refresh button. Is there a line of
code I 've missed above that will do this for me?

Many thanks

James
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
John Goldsmith_Visio_MVP 5/22/2009 1:56 AM PST
  Answer
  Hi James,

SilentMode overrides the default (True) for OpenBrowser. If you use
QuietMode instead (of Silent) then the user only sees the page generation
progress bars, but no other dialogs, plus OpenBrowser will then default to
True and so the page will be displayed and updated.

Best regards

John


John Goldsmith (Visio MVP)
www.visualSignals.typepad.co.uk
www.visualSignals.co.uk


"James Price at Premier" <JamesPriceatPremier@discussions.microsoft.com>
wrote in message news:9929F9B5-A6BE-4C86-9D6B-41E10FEED21D@microsoft.com...
> I’m using Visio 2007 VBA to automate Save as Web Page.
>
> Sub saveAsWebPage()
> Dim saveAsWeb As VisSaveAsWeb
> Dim webSettings As IVisWebPageSettings
>
> Set saveAsWeb = New VisSaveAsWeb
> Set webSettings = saveAsWeb.WebPageSettings
> Set webSettings = saveAsWeb.WebPageSettings
> ' Configure the preferences.
> webSettings.StartPage = 1
> webSettings.EndPage = ThisDocument.Pages.Count - 1
> webSettings.LongFileNames = True
> webSettings.TargetPath = "c:\WardManDemo.htm"
> webSettings.SilentMode = True
>
> saveAsWeb.CreatePages
>
> End Sub
>
> This works fine except that when I re-run the macro the web page (internet
> Explorer 7) only updates when I press the refresh button. Is there a line
> of
> code I 've missed above that will do this for me?
>
> Many thanks
>
> James

 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
James Price at Premier 5/22/2009 4:58 AM PST
   
 
Thanks John. You're a star

James


"John Goldsmith_Visio_MVP" wrote:

> Hi James,
>
> SilentMode overrides the default (True) for OpenBrowser. If you use
> QuietMode instead (of Silent) then the user only sees the page generation
> progress bars, but no other dialogs, plus OpenBrowser will then default to
> True and so the page will be displayed and updated.
>
> Best regards
>
> John
>
>
> John Goldsmith (Visio MVP)
> www.visualSignals.typepad.co.uk
> www.visualSignals.co.uk
>
>
> "James Price at Premier" <JamesPriceatPremier@discussions.microsoft.com>
> wrote in message news:9929F9B5-A6BE-4C86-9D6B-41E10FEED21D@microsoft.com...
> > I’m using Visio 2007 VBA to automate Save as Web Page.
> >
> > Sub saveAsWebPage()
> > Dim saveAsWeb As VisSaveAsWeb
> > Dim webSettings As IVisWebPageSettings
> >
> > Set saveAsWeb = New VisSaveAsWeb
> > Set webSettings = saveAsWeb.WebPageSettings
> > Set webSettings = saveAsWeb.WebPageSettings
> > ' Configure the preferences.
> > webSettings.StartPage = 1
> > webSettings.EndPage = ThisDocument.Pages.Count - 1
> > webSettings.LongFileNames = True
> > webSettings.TargetPath = "c:\WardManDemo.htm"
> > webSettings.SilentMode = True
> >
> > saveAsWeb.CreatePages
> >
> > End Sub
> >
> > This works fine except that when I re-run the macro the web page (internet
> > Explorer 7) only updates when I press the refresh button. Is there a line
> > of
> > code I 've missed above that will do this for me?
> >
> > Many thanks
> >
> > James
>
>
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
  Return to Microsoft Communities  Notify me of replies  
 
Windows Live ID

© 2009 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy Statement