Share via


CreatePages Method

Visio Save As Web Reference

Initiates Web page 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 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 Office Visio saves the active document by default.

Example

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.

Visual Basic for Applications
  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

See Also