OfficeIMO

API Reference

Class

WordSmartArt

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

Represents a SmartArt diagram in a WordDocument.

Inheritance

Methods

public Void AddNode(String text) #
Returns: Void

Adds a new node (algorithmic layouts only: BasicProcess or Cycle) and sets its text.

Parameters

text System.String requiredposition: 0
public Void ClearNodes() #
Returns: Void

Removes all nodes (algorithmic layouts only). Diagram remains with no child nodes.

public String GetNodeText(Int32 index) #
Returns: String

Returns the text of the node at the specified 0-based index.

Parameters

index System.Int32 requiredposition: 0
The 0-based position of the SmartArt node whose text should be retrieved.

Returns

The concatenated text content of the targeted node, or an empty string when the node has no text.

public Void InsertNodeAt(Int32 index, String text) #
Returns: Void

Inserts a node at a specific index (algorithmic layouts only). Re-sequences following nodes.

Parameters

index System.Int32 requiredposition: 0
text System.String requiredposition: 1
public Void RemoveNodeAt(Int32 index) #
Returns: Void

Removes a node by index (algorithmic layouts only).

Parameters

index System.Int32 requiredposition: 0
ReplaceTexts 4 overloads
public Void ReplaceTexts(IEnumerable<String> texts) #
Returns: Void

Replaces node texts sequentially starting at index 0. If more texts are provided than nodes, extras are ignored. If fewer texts are provided, remaining nodes are left unchanged.

Parameters

texts System.Collections.Generic.IEnumerable{System.String} requiredposition: 0
The ordered replacement strings to apply to each node in turn.
public Void ReplaceTexts(params String[] texts) #
Returns: Void

Convenience overload for replacing node texts sequentially using a parameter array.

Parameters

texts System.String[] requiredposition: 0
The ordered replacement strings to apply to each node in turn.
public Void ReplaceTexts(Boolean bold, Boolean italic, Boolean underline, String colorHex = null, Nullable<Double> sizePt = null, params String[] texts) #
Returns: Void

Replaces node texts sequentially while applying the same formatting to every replacement value. If more texts are provided than nodes, extras are ignored. If fewer are provided, remaining nodes are unchanged.

Parameters

texts System.Collections.Generic.IEnumerable{System.String} requiredposition: 0
The ordered replacement strings to apply to each node in turn.
bold System.Boolean requiredposition: 1
True to render each replacement in bold; otherwise false.
italic System.Boolean requiredposition: 2
True to render each replacement in italics; otherwise false.
underline System.Boolean = null optionalposition: 3
True to underline each replacement; otherwise false.
colorHex System.String = null optionalposition: 4
An optional RGB color value (for example, "FF0000") applied to each replacement, or null to keep the existing color.
sizePt System.Nullable{System.Double} = null requiredposition: 5
An optional font size in points applied to each replacement, or null to keep the existing size.
ReplaceTexts(System.Boolean bold, System.Boolean italic, System.Boolean underline, System.String colorHex, System.Nullable{System.Double} sizePt, System.String[] texts) #

Convenience overload that applies the specified formatting to each provided replacement string.

Parameters

bold System.Boolean required
True to render each replacement in bold; otherwise false.
italic System.Boolean required
True to render each replacement in italics; otherwise false.
underline System.Boolean required
True to underline each replacement; otherwise false.
colorHex System.String required
An optional RGB color value (for example, "FF0000") applied to each replacement, or null to keep the existing color.
sizePt System.Nullable{System.Double} required
An optional font size in points applied to each replacement, or null to keep the existing size.
texts System.String[] required
The ordered replacement strings to apply to each node in turn.
SetNodeText 3 overloads
public Void SetNodeText(Int32 index, String text) #
Returns: Void

Sets the text of the node at the specified 0-based index while preserving the paragraph end run properties.

Parameters

index System.Int32 requiredposition: 0
The 0-based position of the SmartArt node whose content should be replaced.
text System.String requiredposition: 1
The replacement text to apply to the node.
public Void SetNodeText(Int32 index, String text, Boolean bold, Boolean italic) #
Returns: Void

Sets the text of the node at the specified 0-based index while applying basic formatting options.

Parameters

index System.Int32 requiredposition: 0
The 0-based position of the SmartArt node whose content should be replaced.
text System.String requiredposition: 1
The replacement text to apply to the node.
bold System.Boolean requiredposition: 2
True to render the new text in bold; otherwise false.
italic System.Boolean requiredposition: 3
True to render the new text in italics; otherwise false.
public Void SetNodeText(Int32 index, String text, Boolean bold, Boolean italic, Boolean underline, String colorHex, Nullable<Double> sizePt) #
Returns: Void

Sets the text of the node at the specified 0-based index while applying extended formatting options.

Parameters

index System.Int32 requiredposition: 0
The 0-based position of the SmartArt node whose content should be replaced.
text System.String requiredposition: 1
The replacement text to apply to the node.
bold System.Boolean requiredposition: 2
True to render the new text in bold; otherwise false.
italic System.Boolean requiredposition: 3
True to render the new text in italics; otherwise false.
underline System.Boolean requiredposition: 4
True to underline the new text; otherwise false.
colorHex System.String requiredposition: 5
An optional RGB color value (for example, "FF0000") applied to the new text, or null to keep the existing color.
sizePt System.Nullable{System.Double} requiredposition: 6
An optional font size in points applied to the new text, or null to keep the existing size.

Properties

public Int32 NodeCount { get; } #

Gets the number of editable node paragraphs in the SmartArt. Nodes are detected as points that have a text body and no explicit type (not doc/parTrans/sibTrans/pres).

public Boolean CanModifyNodes { get; } #

Indicates whether this SmartArt type supports adding/removing/reordering nodes.