I am attempting to drop a custom shape into my open Visio document, and link it to data which I have imported from a SQL database. I have the stencil loaded into Visio. Currently I can drop rectangles on the screen and link them. Here is what I have so far:
For i = 1 To 6
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 = ActivePage.DrawRectangle(1, 3, 2, 1)
vsoShape.LinkToData vsoDataRecordset.ID, i, True
Next i