Share via


SaveAsWebObject Property [Visio 2003 SDK Documentation]

Returns a reference to the IDispatch interface of a VisSaveAsWeb object.

objRet = object.SaveAsWebObject

objRet    IDispatch. A reference to the new VisSaveAsWeb object.

object    Required. An expression that returns an Application or InvisibleApp object.

Version added

2003

Remarks

Once you have a reference to the VisSaveAsWeb object, you can use the objects, methods, and properties of the Save as Web Page API to publish Microsoft Office Visio 2003 documents to the Web. For more information about the Save as Web Page API, search for "Save as Web Page API" on MSDN.

To be able to work with the Save as Web Page API, you must get a reference to the Microsoft Visio 2003 SaveAsWeb Type Library in your Microsoft Visual Basic or Microsoft Visual Basic for Applications (VBA) project. To get this reference in VBA, use the following procedure:

  1. On the Tools menu, point to Macros, and then click Visual Basic Editor.
  2. On the Tools menu, click References.
  3. In the Available References list, select Microsoft Visio 2003 SaveAsWeb Type Library and click OK.

Example

As it applies to the Application object.

This VBA macro shows how to use the SaveAsWebObject property to get a VisSaveAsWeb object. It also shows how to get a VisWebPageSettings object, configure Web-page settings, and create a Web page to display the active Visio document. The macro gets a Visio Application object and passes it to the SaveAsWeb procedure, which gets the VisSaveAsWeb object, configures the settings, and creates the Web page.

Before running this macro, get a reference to the Microsoft Visio 2003 SaveAsWeb Type Library as described above, and replace path\filename in the code with the full path to and name of the .htm file you want to create on your computer to display the Web page.

Public Sub SaveAsWebObject_Example

    Dim vsoApplication as Visio.Application
    Call SaveAsWeb(vsoApplication)

End Sub


Public Sub SaveAsWeb (vsoApplication as Visio.Application)

    Dim objSaveAsWeb As IVisSaveAsWeb
    Dim objWebPageSettings As IVisWebPageSettings

    ' Get a VisSaveAsWeb object that 
    ' represents a new Web page project
    Set objSaveAsWeb = Application.SaveAsWebObject

    ' Get a VisWebPageSettings object
    Set objWebPageSettings = objSaveAsWeb.WebPageSettings

    ' Configure Web-page settings
    objWebPageSettings.StartPage = 1
    objWebPageSettings.EndPage = 2
    objWebPageSettings.LongFileNames = True
    objWebPageSettings.TargetPath = "path\filename"

    ' Now create the pages; because we did not identify 
    ' a particular document, the active document is saved
    objSaveAsWeb.CreatePages

End Sub

Applies to | Application object | InvisibleApp object