TargetPath property

TargetPath property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Indicates the path where the Web page and its supporting files are placed.

        
          retStr = object.TargetPath
object. TargetPath = valStr

retStr

String. The current target path.

object

Required. An expression that returns a VisPageWebSettings object.

valStr

Required String. The new target path.

Remarks

When saving a drawing as a Web page, you must supply the full target path using the TargetPath property. Once this value is set during an instance of Microsoft Visio, it is used as the default path unless another path is explicitly supplied. This value is not persisted between instances of Visio.

The TargetPath property corresponds to the folder name and file name selected in the Save As dialog box (on the File menu, click Save as Web Page).

Example

The following macro demonstrates saving the active document as a Web page, and placing the HTML and supporting files as flat files in the webpages folder.

  Public Sub saveAsWeb()
  Dim saveAsWeb As VisSaveAsWeb
  Dim webSettings As VisWebPageSettings
  
  Set saveAsWeb = New VisSaveAsWeb
  Set webSettings = saveAsWeb.WebPageSettings
     webSettings.StoreInFolder = False
     webSettings.TargetPath = "c:\webpages\webpage.htm"
     saveAsWeb.CreatePages
  End Sub