VisSaveAsWeb.CreatePages method

Initiates webpage creation.

Syntax

expression.CreatePages

expression An expression that returns a VisSaveAsWeb object.

Return value

Nothing

Remarks

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

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

Example

The following example shows how to open an existing file and save it as a webpage 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 webpage 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
        .CreatePages 
    End With
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.