Share via


How to: Programmatically Close Visio Documents

You can close the active Microsoft Office Visio document by using the Microsoft.Office.Interop.Visio.Document.Close method.

For details about this method, see the VBA reference documentation for the Microsoft.Office.Interop.Visio.Document.Close method.

Closing the Active Document

To close the active document

  • Call the Microsoft.Office.Interop.Visio.Document.Close method to close the active document.

    To use the following code example, run it in the ThisAddIn class in an application-level project for Visio.

    Me.Application.ActiveDocument.Close()
    
    this.Application.ActiveDocument.Close();
    

See Also

Tasks

How to: Programmatically Create New Visio Documents

How to: Programmatically Open Visio Documents

How to: Programmatically Save Visio Documents

How to: Programmatically Print Visio Documents

Concepts

Visio Object Model Overview

Other Resources

Visio Solutions