Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordSmartArt

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
0eef6a5756b9 with working tree changes

Represents a SmartArt diagram in a WordDocument.

Inheritance

Usage

Explore 10 API references to this type

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

Methods

public WordSmartArtNode AddNode(string text) #

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

Parameters

text string required

Returns

WordSmartArtNode The attached node, addressed independently of its position.
public void ClearNodes() #

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

public string GetNodeText(int index) #

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

Parameters

index int required
The 0-based position of the SmartArt node whose text should be retrieved.

Returns

string The concatenated text content of the targeted node, or an empty string when the node has no text.
public void InsertNodeAt(int index, string text) #

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

Parameters

index int required
text string required
public void MoveNode(int fromIndex, int toIndex) #

Reorders one node inside a supported algorithmic layout by changing its document-child order. This is a structural SmartArt ordering edit, not a rendered-coordinate move.

Parameters

fromIndex int required
toIndex int required
public void RemoveNodeAt(int index) #

Removes a node by index (algorithmic layouts only).

Parameters

index int required
ReplaceTexts 4 overloads
public void ReplaceTexts(IEnumerable<string> texts) #

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<string> required
The ordered replacement strings to apply to each node in turn.
public void ReplaceTexts(params string[] texts) #

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

Parameters

texts string[] required
The ordered replacement strings to apply to each node in turn.
public void ReplaceTexts(IEnumerable<string> texts, bool bold, bool italic, bool underline, OfficeColor? color = null, OfficeLength? fontSize = null) #

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<string> required
The ordered replacement strings to apply to each node in turn.
bold bool required
True to render each replacement in bold; otherwise false.
italic bool required
True to render each replacement in italics; otherwise false.
underline bool required
True to underline each replacement; otherwise false.
color OfficeIMO.OfficeColor? = null optional
An optional RGB color applied to each replacement, or null to keep the existing color.
fontSize OfficeIMO.OfficeLength? = null optional
An optional physical font size applied to each replacement, or null to inherit the diagram font size.
public void ReplaceTexts(bool bold, bool italic, bool underline, OfficeColor? color = null, OfficeLength? fontSize = null, params string[] texts) #

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

Parameters

bold bool required
True to render each replacement in bold; otherwise false.
italic bool required
True to render each replacement in italics; otherwise false.
underline bool required
True to underline each replacement; otherwise false.
color OfficeIMO.OfficeColor? = null optional
An optional RGB color applied to each replacement, or null to keep the existing color.
fontSize OfficeIMO.OfficeLength? = null optional
An optional physical font size applied to each replacement, or null to inherit the diagram font size.
texts string[] required
The ordered replacement strings to apply to each node in turn.
SetNodeText 3 overloads
public void SetNodeText(int index, string text) #

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

Parameters

index int required
The 0-based position of the SmartArt node whose content should be replaced.
text string required
The replacement text to apply to the node.
public void SetNodeText(int index, string text, bool bold, bool italic) #

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

Parameters

index int required
The 0-based position of the SmartArt node whose content should be replaced.
text string required
The replacement text to apply to the node.
bold bool required
True to render the new text in bold; otherwise false.
italic bool required
True to render the new text in italics; otherwise false.
public void SetNodeText(int index, string text, bool bold, bool italic, bool underline, OfficeColor? color, OfficeLength? fontSize) #

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

Parameters

index int required
The 0-based position of the SmartArt node whose content should be replaced.
text string required
The replacement text to apply to the node.
bold bool required
True to render the new text in bold; otherwise false.
italic bool required
True to render the new text in italics; otherwise false.
underline bool required
True to underline the new text; otherwise false.
color OfficeIMO.OfficeColor? required
An optional RGB color applied to the new text, or null to keep the existing color.
fontSize OfficeIMO.OfficeLength? required
An optional physical font size applied to the new text, or null to inherit the diagram font size.
public bool TryGetLayoutSnapshot(out WordDrawingLayoutInfo snapshot) #

Reads persisted inline or anchored package geometry for this SmartArt diagram.

Parameters

snapshot OfficeIMO.Word.WordDrawingLayoutInfo required
The package-geometry snapshot when the diagram has a supported frame.

Returns

bool true when persisted layout evidence was available.

Properties

public int 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 bool CanModifyNodes { get; } #

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

public IReadOnlyList<WordSmartArtNode> Nodes { get; } #

Gets attached editable nodes in their current diagram order.