Discussion:
Visio Save as Web query
(too old to reply)
James Price at Premier
2009-05-22 07:03:01 UTC
Permalink
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
John Goldsmith_Visio_MVP
2009-05-22 08:52:16 UTC
Permalink
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
Post by James Price at Premier
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
James Price at Premier
2009-05-22 11:59:00 UTC
Permalink
Thanks John. You're a star

James
Post by John Goldsmith_Visio_MVP
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
Post by James Price at Premier
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
Loading...