Shape.BreakLinkToData Method (Visio)
Published: July 16, 2012
Breaks the link between the shape and the data row to which it is linked in the specified data recordset.
This Visio object or member is available only to licensed users of Visio Professional 2013.
The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the BreakLinkToData method to break the link between a shape and a data row in a data recordset.
Before running this macro, place a shape on the page, add at least one data recordset to the DataRecordsets collection of the document, and use any linking method to link the shape to a data row in the data recordset you most recently added to the collection. Alternatively, you could link the shape to a data row by dragging the row from the External Data window onto the shape in the Visio user interface. Then select the linked shape.
Public Sub BreakLinkToData_Example() Dim vsoDataRecordset As Visio.DataRecordset Dim vsoShape As Visio.Shape Dim intCount As Integer intCount = Visio.ActiveDocument.DataRecordsets.Count Set vsoDataRecordset = Visio.ActiveDocument.DataRecordsets(intCount) Set vsoShape = ActiveWindow.Selection.PrimaryItem vsoShape.BreakLinkToData (vsoDataRecordset.ID) End Sub