使用vba更改层次结构智能作品的属性

时间:2019-03-27 15:25:44

标签: excel vba diagram

我写了一些创建层次结构图的代码。

Set list = ActiveWorkbook.Sheets("List")
Set oSALayout = Application.SmartArtLayouts(88) 'reference to organization chart
Set oShp = ActiveWorkbook.Sheets("Diagram").Shapes.AddSmartArt(oSALayout)

Set QNodes = oShp.SmartArt.AllNodes
For i = 1 To 5      'delete all included nodes
    oShp.SmartArt.AllNodes(1).Delete
Next


Set ProjectTarget = oShp.SmartArt.AllNodes.Add
ProjectTarget.TextFrame2.TextRange.Text = "Project Target"

Set OutcomeTarget = ProjectTarget.AddNode(msoSmartArtNodeBelow)
OutcomeTarget.TextFrame2.TextRange.Text = "Outcome Targets"

Set ProcessTarget = ProjectTarget.AddNode(msoSmartArtNodeBelow)
ProcessTarget.TextFrame2.TextRange.Text = "Process Targets"

Set NonTarget = ProjectTarget.AddNode(msoSmartArtNodeBelow)
NonTarget.TextFrame2.TextRange.Text = "Non-Targets"

结果图如下所示

Link

现在,我想知道是否有可能: -更改图表的大小和位置 -更改单个节点的颜色 隐藏节点(我发现属性为“隐藏”,但它是只读的)

提前谢谢

0 个答案:

没有答案