VisSaveAsWeb.AttachToVisioDoc method
Indicates which document to save as a webpage.
Syntax
expression.AttachToVisioDoc (docObj)
expression An expression that returns a VisSaveAsWeb object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
docObj | Required | Document | An Automation object that supports the IVDocument interface. |
Return value
Nothing
Remarks
Microsoft Visual Basic programs can pass a Visio Document object to this method because objects created from the Visio Document class support the IVDocument interface.
The AttachToVisioDoc method queries the IUnknown interface for the presence of the IVDocument interface.
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 AttachToVisioDoc_Example ()
Dim vsoSaveAsWeb As VisSaveAsWeb
Dim vsoWebSettings As VisWebPageSettings
Dim vsoDocument As Visio.Document
Set vsoDocument = Application.Documents.Open("<variable>path\filename</variable>")
Set vsoSaveAsWeb = Visio.Application.SaveAsWebObject
Set vsoWebSettings = vsoSaveAsWeb.WebPageSettings
vsoWebSettings.TargetPath = "<variable>targetpath\filename</variable>"
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.