Shapes.AddDiagram Method

Returns a Shape object that represents a newly created diagram in a document.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function AddDiagram ( _
    Type As MsoDiagramType, _
    Left As Single, _
    Top As Single, _
    Width As Single, _
    Height As Single, _
    ByRef Anchor As Object _
) As Shape
'Usage
Dim instance As Shapes
Dim Type As MsoDiagramType
Dim Left As Single
Dim Top As Single
Dim Width As Single
Dim Height As Single
Dim Anchor As Object
Dim returnValue As Shape

returnValue = instance.AddDiagram(Type, _
    Left, Top, Width, Height, Anchor)
Shape AddDiagram(
    MsoDiagramType Type,
    float Left,
    float Top,
    float Width,
    float Height,
    ref Object Anchor
)

Parameters

  • Type
    Type: MsoDiagramType
    Required MsoDiagramType.
    MsoDiagramType can be one of these constants.
    msoDiagramCycle – Shows a process with a continuous cycle.
    msoDiagramMixed – Not used with this method.
    msoDiagramOrgChart – Shows hierarchical relationships.
    msoDiagramPyramid – Shows foundation-based relationships.
    msoDiagramRadial – Shows relationships of a core element.
    msoDiagramTarget – Shows steps toward a goal.
    msoDiagramVenn – Shows areas of overlap between elements.
  • Left
    Type: System.Single
    Required Single. The position, measured in points, of the left edge of the diagram's bounding box relative to the anchor.
  • Top
    Type: System.Single
    Required Single. The position, measured in points, of the top edge of the diagram's bounding box relative to the anchor.
  • Width
    Type: System.Single
    Required Single. The width, measured in points, of the diagram's bounding box.
  • Height
    Type: System.Single
    Required Single. The height, measured in points, of the diagram's bounding box.
  • Anchor
    Type: System.Object%
    Optional Object. A Range object that represents the text to which the diagram is bound. If Anchor is specified, the anchor is positioned at the beginning of the first paragraph in the anchoring range. If this argument is omitted, the anchoring range is selected automatically and the diagram is positioned relative to the top and left edges of the page.

Return Value

Type: Microsoft.Office.Interop.Word.Shape

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.Word Namespace