Shape.Delete Method (Visio)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Deletes an object or selection.

expression .Delete

expression A variable that represents a Shape object.

Return Value

Nothing

If your Visual Studio solution includes the Microsoft.Office.Interop.Visio reference, this method maps to the following types:

  • Microsoft.Office.Interop.Visio.IVShape.Delete()

This example shows how to delete Shape objects.

 
Public Sub Delete_Example()  
 
    Dim vsoShape As Visio.Shape  
 
    Set vsoShape = ActivePage.DrawLine(1, 1, 5, 5)  
 
    vsoShape.Delete  
 
End Sub   

Show: