Table of contents
Collapse the table of content
Expand the table of content

VisSaveAsWeb.CreatePages Method (Visio Save As Web)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Initiates Web page creation.


expression. CreatePages

_expression_An expression that returns a ** VisSaveAsWeb** object.

Return Value



Because the VisSaveAsWeb object uses the settings in its ** VisWebPageSettings** object to create the Web page, you should call the CreatePages method after you make any required changes to the VisWebPageSettings object.

To specify which document to save as a Web page, use the AttachToVisioDoc method. If no document is specified, Microsoft Visio saves the active document by default.


The following example shows how to open an existing file and save it as a Web page by using the Save as Web Page feature's default settings and the AttachToVisioDoc and CreatePages methods. Before running this example, replace path\filename with a valid path and file name for a Visio document to pass to the Open method. In addition, replace targetpath\filename with a valid target path and a file name for the Web page project files.

Public Sub CreatePages_Example () 
    Dim vsoSaveAsWeb As VisSaveAsWeb 
    Dim vsoWebSettings As VisWebPageSettings 
    Dim vsoDocument As Visio.Document

    Set vsoDocument = Application.Documents.Open("path\filename") 
    Set vsoSaveAsWeb = Visio.Application.SaveAsWebObject 
    Set vsoWebSettings = vsoSaveAsWeb.WebPageSettings

    vsoWebSettings.TargetPath = "targetpath\filename"

    With vsoSaveAsWeb
        .AttachToVisioDoc vsoDocument
    End With
End Sub
© 2018 Microsoft