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

VisWebPageSettings.TargetPath Property (Visio Save As Web)

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

Specifies the path where the Web page and its supporting files are placed. Read/write.


expression. TargetPath

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

Return Value



When you save a drawing as a Web page, you must use the TargetPath property to supply the full target path. The TargetPath property is reset to a null value after each export: each time you save a drawing as a Web page you must explicitly supply the target path. In addition, the TargetPath value is not persisted between sessions of Visio.

The value of the TargetPath property corresponds to the folder name and file name selected in the Save As dialog box (click the BackstageButton tab, and then click Save As).


The following macro shows how to save the active document as a Web page and place the resulting HTML file and supporting files as flat files in the targetpath folder. Because the StoreInFolder property is set to False, the supporting files are placed in the same folder as the root HTML file, instead of in a separate folder that has the name filename_files or filename.files, depending on the language.

Public Sub TargetPath_Example()
    Dim vsoSaveAsWeb As VisSaveAsWeb 
    Dim vsowebSettings As VisWebPageSettings

    Set vsoSaveAsWeb = Visio.Application.SaveAsWebObject 
    Set vsoWebSettings = vsoSaveAsWeb.WebPageSettings

    With vsoWebSettings
         .StoreInFolder = False
         .TargetPath = "<variable>targetpath\filename.htm</variable>"
    End With

End Sub
© 2018 Microsoft