1

SmartArt 图形可以具有与“节点”关联的图片(尽管这仅由某些 SmartArt 模板使用)。我知道如何通过 VBA/VSTO 自动化设置节点的文本,但我不知道如何设置图片。

可以做到吗?

4

1 回答 1

2

尝试这样的事情 - 如果您使用 smartart 在 VBA 中完成了任何工作,这应该是有道理的。

Dim oSALayout As SmartArtLayout
Dim QNode As SmartArtNode
Dim oShp As Shape

Set oSALayout = Application.SmartArtLayouts(91) 'reference to organization chart
Set oShp = Chart.Shapes.AddSmartArt(oSALayout, ileft, 2, iWidth, iHeight)    
Set QNode = oShp.SmartArt.AllNodes.Add

...

' note that there may be more than one shape associated with each node, I found that those org chart/smart art layouts with a specific "picture box" typically use Shapes.Item(2) 

With QNode.Shapes.Item(1).Fill
    .Visible = msoTrue
    .UserPicture "c:\somepath\picture.jpg"
    .TextureTile = msoFalse
End With

希望这是有道理的!

于 2013-11-04T02:17:51.480 回答