DataRecordset.Delete method (Visio)

Deletes the DataRecordset object from the DataRecordsets collection of the document. .

Note

This Visio object or member is available only to licensed users of Visio Professional 2013.

Syntax

expression.Delete

expression A variable that represents a DataRecordset object.

Return value

Nothing

Remarks

If the DataRecordset object to be deleted is associated with a DataConnection object, and if that DataConnection object is not associated with any other DataRecordset objects, Microsoft Visio also deletes the DataConnection object.

Note that deleting a DataRecordset object does not delete the shapes that had been linked to data in that data recordset, nor does delete any existing shape data in those shapes that was created when the shapes were linked to data.

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Delete method to delete a DataRecordset from the DataRecordsets collection of the current document. It gets the count of all data recordsets associated with the current document and deletes the one most recently added.

Public Sub Delete_Example() 
 
    Dim vsoDataRecordset As Visio.DataRecordset 
    Dim intCount As Integer 
 
    intCount = ThisDocument.DataRecordsets.Count 
    Set vsoDataRecordset = ThisDocument.DataRecordsets(intCount) 
    vsoDataRecordset.Delete 
 
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.