API Reference

Class

WordShape

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

Represents simple shapes inside a paragraph.

Inheritance

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Methods

public static WordShape AddDrawingShape(WordParagraph paragraph, WordShapeType shapeType, Double widthPt, Double heightPt) #
Returns: WordShape

Adds a DrawingML shape to the given paragraph.

Parameters

paragraph OfficeIMO.Word.WordParagraph requiredposition: 0
Paragraph to append the shape to.
shapeType OfficeIMO.Word.WordShapeType requiredposition: 1
Type of shape to create.
widthPt System.Double requiredposition: 2
Width in points.
heightPt System.Double requiredposition: 3
Height in points.
public static WordShape AddDrawingShapeAnchored(WordParagraph paragraph, WordShapeType shapeType, Double widthPt, Double heightPt, Double leftPt, Double topPt) #
Returns: WordShape

Adds a DrawingML shape anchored at an absolute position on the page.

Parameters

paragraph OfficeIMO.Word.WordParagraph requiredposition: 0
Paragraph to host the WordDrawing anchor.
shapeType OfficeIMO.Word.WordShapeType requiredposition: 1
Type of shape.
widthPt System.Double requiredposition: 2
Width in points.
heightPt System.Double requiredposition: 3
Height in points.
leftPt System.Double requiredposition: 4
Left offset in points from the page.
topPt System.Double requiredposition: 5
Top offset in points from the page.
AddEllipse 2 overloads
public static WordShape AddEllipse(WordParagraph paragraph, Double widthPt, Double heightPt, String fillColor = "#FFFFFF") #
Returns: WordShape

Adds an ellipse shape to the given paragraph.

Parameters

paragraph OfficeIMO.Word.WordParagraph requiredposition: 0
widthPt System.Double requiredposition: 1
heightPt System.Double requiredposition: 2
fillColor System.String = "#FFFFFF" optionalposition: 3
public static WordShape AddEllipse(WordParagraph paragraph, Double widthPt, Double heightPt, OfficeColor fillColor) #
Returns: WordShape

Adds an ellipse shape using OfficeColor.

Parameters

arg1 OfficeIMO.Word.WordParagraph requiredposition: 0
arg2 System.Double requiredposition: 1
arg3 System.Double requiredposition: 2
arg4 OfficeIMO.Drawing.OfficeColor requiredposition: 3
AddLine 2 overloads
public static WordShape AddLine(WordParagraph paragraph, Double startXPt, Double startYPt, Double endXPt, Double endYPt, String color = "#000000", Double strokeWeightPt = 1) #
Returns: WordShape

Adds a line shape to the given paragraph.

Parameters

paragraph OfficeIMO.Word.WordParagraph requiredposition: 0
startXPt System.Double requiredposition: 1
startYPt System.Double requiredposition: 2
endXPt System.Double requiredposition: 3
endYPt System.Double requiredposition: 4
color System.String = "#000000" optionalposition: 5
strokeWeightPt System.Double = 1 optionalposition: 6
public static WordShape AddLine(WordParagraph paragraph, Double startXPt, Double startYPt, Double endXPt, Double endYPt, OfficeColor color, Double strokeWeightPt = 1) #
Returns: WordShape

Adds a line shape using OfficeColor.

Parameters

arg1 OfficeIMO.Word.WordParagraph requiredposition: 0
arg2 System.Double requiredposition: 1
arg3 System.Double requiredposition: 2
arg4 System.Double requiredposition: 3
arg5 System.Double requiredposition: 4
arg6 OfficeIMO.Drawing.OfficeColor requiredposition: 5
arg7 System.Double = 1 optionalposition: 6
AddPolygon 2 overloads
public static WordShape AddPolygon(WordParagraph paragraph, String points, String fillColor = "#FFFFFF", String strokeColor = "#000000") #
Returns: WordShape

Adds a polygon shape to the given paragraph.

Parameters

paragraph OfficeIMO.Word.WordParagraph requiredposition: 0
points System.String requiredposition: 1
fillColor System.String = "#FFFFFF" optionalposition: 2
strokeColor System.String = "#000000" optionalposition: 3
public static WordShape AddPolygon(WordParagraph paragraph, String points, OfficeColor fillColor, OfficeColor strokeColor) #
Returns: WordShape

Adds a polygon shape using OfficeColor values.

Parameters

arg1 OfficeIMO.Word.WordParagraph requiredposition: 0
arg2 System.String requiredposition: 1
arg3 OfficeIMO.Drawing.OfficeColor requiredposition: 2
arg4 OfficeIMO.Drawing.OfficeColor requiredposition: 3
public static WordShape AddRoundedRectangle(WordParagraph paragraph, Double widthPt, Double heightPt, String fillColor = "#FFFFFF", Double arcSize = 0.25) #
Returns: WordShape

Adds a rounded rectangle shape to the given paragraph.

Parameters

paragraph OfficeIMO.Word.WordParagraph requiredposition: 0
widthPt System.Double requiredposition: 1
heightPt System.Double requiredposition: 2
fillColor System.String = "#FFFFFF" optionalposition: 3
arcSize System.Double = 0.25 optionalposition: 4
public Void Remove() #
Returns: Void

Removes the shape from the paragraph.

public Boolean TryGetLayoutSnapshot(out WordDrawingLayoutSnapshot snapshot) #
Returns: Boolean

Reads persisted inline or anchored package geometry for this DrawingML shape.

Parameters

snapshot OfficeIMO.Word.WordDrawingLayoutSnapshot@ requiredposition: 0
The package-geometry snapshot when this is a DrawingML shape with a supported frame.

Returns

true for DrawingML shapes with persisted frame geometry; VML-only shapes return false.

Properties

public String FillColorHex { get; set; } #

Gets or sets the fill color as hexadecimal string (no leading '#', lowercase).

public OfficeColor FillColor { get; set; } #

Gets or sets the fill color using OfficeColor.

public String Id { get; set; } #

Identifier of the shape.

public String Title { get; set; } #

Optional title of the shape.

public String Description { get; set; } #

Alternative text description of the shape.

public Nullable<Boolean> Hidden { get; set; } #

Whether the shape is hidden. Stored as "visibility:hidden" in the style string.

public String StrokeColorHex { get; set; } #

Outline color in hex format (no leading '#', lowercase). Null when not applicable.

public OfficeColor StrokeColor { get; set; } #

Outline color using OfficeColor.

public Nullable<Double> StrokeWeight { get; set; } #

Outline thickness in points.

public Nullable<Double> ArcSize { get; set; } #

Corner roundness as a fraction between 0 and 1 for rounded rectangles.

public Nullable<Boolean> Stroked { get; set; } #

Determines whether the outline is drawn.

public Nullable<Int32> ZIndex { get; set; } #

Gets or sets the z-index for VML shapes (style "z-index"). DrawingML is not affected.

public Double Width { get; set; } #

Width of the shape in points.

public Double Height { get; set; } #

Height of the shape in points.

public Nullable<Double> Left { get; set; } #

Left position of the shape in points. Returns null when not explicitly set.

public Nullable<Double> Top { get; set; } #

Top position of the shape in points. Returns null when not explicitly set.

public Nullable<Double> Rotation { get; set; } #

Rotation of the shape in degrees. Returns null when not set.