DocumentSavedAs event

Microsoft Visio Developer Reference

DocumentSavedAs event

   Example   

Occurs after a document is saved using the Save As command.

Version added

4.1

Syntax

Private Sub object_DocumentSavedAs(ByVal doc As IVDocument)

object

The WithEvents object that receives the event.

Remarks

The DocumentSavedAs event is one of a group of events for which the EventInfo property of the Application object contains extra information.

If the DocumentSavedAs event is fired because a save was initiated by a user or a program, the EventInfo property returns the following string:

"/saveasfile=<filename>"

If it fires because Visio is saving a copy of an open file (for autorecovery or to include as a mail attachment), the EventInfo property returns one of the following strings:

  • If the event is fired for autorecovery purposes, the name of a recovery file in this format: "/autosavefile=C:\TEMP\~$2VSO2FD.vsd"
  • If the event is fired because a document copy is being made to send as a mail attachment, the name of an attachment file in this format: "/mailfile=C:\TEMP\~$2VSO2FD.vsd"

If you're using Microsoft Visual Basic or Visual Basic for Applications, the syntax in this topic describes a common, efficient way to handle events.

If you want to create your own Event objects, use the Add or AddAdvise method. To create an Event object that runs an add-on, use the Add method as it applies to the EventList collection. To create an Event object that receives notification, use the AddAdvise method. To find an event code for the event you want to create, see Event codes.

If you are handling this event from a program that receives a notification over a connection created with the AddAdvise method, the vMoreInfo argument to VisEventProc designates the document index: "/doc=1".