Visio2003: Automate HTML convertion

S

Sven Weindel

Hi all,

I want to automate the function 'SaveAsWebPage' with a macro.

Unfortunately I can't record the single work steps (File -> SaveAsWebPage) -
after the record I see only the Sub <Name> and EndSub - statement.

After search in the web and VisioHelp I found the function
'SaveAsWebObject' - perhaps this is the responsible function for that.

Unfortunately I can't run the example function, because 2 object (?) types
(in detail: IVisSaveAsWeb and IVisWebPageSettings) are inexistent in my
Visio2003 version (with VB 6.3 and VBA 6.499.72).

In Detail here the example:
-----------------------------------------------------------------------
Public Sub SaveAsWebObject_Example()

Dim vsoApplication As Application
Call SaveAsWeb(vsoApplication)

End Sub

Private Public Sub SaveAsWeb(vsoApplication As Visio.Application)

Dim objSaveAsWeb As IVisSaveAsWeb
Dim objWebPageSettings As IVisWebPageSettings
'Get a VisSaveAsWeb object that represents a new Web page project
Set objSaveAsWeb = Application.SaveAsWebObject
'Get a VisWebPageSettings object
Set objWebPageSettings = objSaveAsWeb.WebPageSettings
'Configure Web-page settings
objWebPageSettings.StartPage = 1
objWebPageSettings.EndPage = 2
objWebPageSettings.LongFileNames = True
objWebPageSettings.TargetPath = "\path\filename"

End Sub
-----------------------------------------------------------------------

Can anybody help me with my problem?

Thanks in advance & regards,
Sven
 
D

David Parker [Visio MVP]

Try adding reference to Microsoft Visio 11.0 Save As Web Type Library ?
 
S

Sven Weindel

Hi David,
Try adding reference to Microsoft Visio 11.0 Save As Web Type Library ?

thanks for your tip - now the convertion works fine! :)

Before the convertion start customizing properties are displayed.
How can I skip automate the customizing properties with 'OK' for a automate
convertion start?

Thanks & Regards,
Sven
 
S

Sven Weindel

Update:
Before the convertion start customizing properties are displayed.
How can I skip automate the customizing properties with 'OK' for a automate
convertion start?

I found the command:

objWebPageSettings.QuietMode = True -> no select box is visible
objWebPageSettings.SilentMode = False -> no select box & convert
popups are visible


But I can't find the right command for set up the OutputFormat....I think
perhaps it is

objWebPageSettings.GetFormatName

but I can't find the right expressions to set up for running....

for example: false command: objWebPageSettings.GetFormatName(1, SVG) =
True

Can anybody help me to set up the right OutputFormat?

Thanks in advance & Regards,
Sven
 
J

junethesecond

PriFormat property( the primary output format for the Web page) might be
what you are looking for.
For example,
.PriFormat = "PNG"
 
S

Sven Weindel

Hi,
PriFormat property( the primary output format for the Web page) might be
what you are looking for.
For example,
.PriFormat = "PNG"

thanks a lot for this tip! :)

Regards,
Sven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top