Can anyone point me to a good description of the OBJ model for smart art ?
Ta!
C57
Ta!
C57
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
call activesheet.shapes.addsmartart(application.smartart.layouts(...)).select
...
Sub test()
Dim shpSmartArt As Shape
Dim strSAname As String
strSAname = "mySmartArt"
' create sample SmartArt
Set shpSmartArt = CreateSmartArt(strSAname)
' move 'child node 3' up
shpSmartArt.SmartArt.Nodes(1).Nodes(3).ReorderUp
' change 'child node 3' text, now second cild node
shpSmartArt.SmartArt.Nodes(1).Nodes(2).TextFrame2.TextRange = "changed text"
End Sub
Public Function CreateSmartArt(sName As String) As Shape
Dim shpSmartArt As Shape
' create sample SmartArt
Set shpSmartArt = ActiveSheet.Shapes.AddSmartArt(Application.SmartArtLayouts("urn:microsoft.com/office/officeart/2008/layout/LinedList"))
With shpSmartArt
.Name = sName
With .SmartArt
'remove all except root default child nodes
For i = .AllNodes.Count To 2 Step -1
.AllNodes.Item(i).Delete
Next i
With .Nodes(1)
.TextFrame2.TextRange = "root node"
For i = 1 To 5
With .Nodes.Add
.TextFrame2.TextRange = "child node " & i
.Demote
End With
Next i
End With
End With
End With
Set CreateSmartArt = shpSmartArt
End Function