|
发表于 2024-10-1 15:59
来自手机
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
dongdonggege 发表于 2024-10-1 09:40
哪位老师教我,谢谢。
'Word365组织结构图简单示例如下
'Word03可以参考一下
Sub Word365组织结构图()
Dim app As Application
Dim shp As Shape, stm As SmartArt
Set app = Application
With app.ActiveDocument
Set shp = .Shapes.AddSmartArt( _
app.SmartArtLayouts(1), _
10, 10, 200, 100)
Set stm = shp.SmartArt
k = 1
For Each Nd In stm.Nodes
Nd.TextFrame2.TextRange.Text = k
k = k + 1
Next
End With
Set shp = Nothing
Set stm = Nothing
Set app = Nothing
End Sub |
|