如果该属性值为 MsoTrue,则图形是一个图表顶点。MsoTriState,只读。
MsoTriState 可以是下列 MsoTriState 常量之一: |
msoCTrue 不应用于该属性。 |
msoFalse 如果图形不是一个图表顶点则返回该常量。 |
msoTriStateMixed 不应用于该属性。 |
msoTriStateToggle 不应用于该属性。 |
msoTrue 如果图形是一个图表节点则返回该常量。 |
expression.HasDiagramNode
expression 必需。该表达式返回“应用于”列表中的一个对象。
本示例在当前文档中查找带顶点的图表,如果找到,则创建一个有白色粗体字的黑色气球。
Sub HasDiagramProperties()
Dim shpDiagram As Shape
Dim shpNode As DiagramNode
Dim shpBalloon As Shape
Dim docThis As Document
Set docThis = ThisDocument
'Looks through the current document and when it finds a diagram
' with one or more diagram nodes, creates a balloon with text
For Each shpDiagram In docThis.Shapes
If shpDiagram.HasDiagram = msoTrue _
And shpDiagram.HasDiagramNode = msoTrue Then
Set shpBalloon = docThis.Shapes.AddShape( _
Type:=msoShapeBalloon, Left:=350, _
Top:=75, Width:=150, Height:=150)
With shpBalloon
With .TextFrame.TextRange
.Text = "This is a diagram with nodes."
.Font.Color = wdColorWhite
.Font.Bold = True
.Font.Name = "Tahoma"
.Font.Size = 15
End With
.Line.BackColor.RGB = RGB( _
Red:=0, Green:=25, Blue:=25)
.Fill.ForeColor.RGB = RGB( _
Red:=0, Green:=25, Blue:=25)
End With
End If
Next shpDiagram
End Sub