Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordSectionScope

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
22fb5b2be3d2 with working tree changes
Modifiers
sealed

Edits one WordSection: its fluent methods and keywords, each returning this scope.

Inheritance

  • object
  • WordSectionScope

Usage

Explore 29 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.

Accepted by parameters 1

Methods

public WordSectionScope Bookmark(WordBookmark item) #

Adds an item to WordSection.Bookmarks: Gets all bookmarks defined in the section.

Parameters

item OfficeIMO.Word.WordBookmark required
The item.

Returns

WordSectionScope The same scope.
public WordSectionScope Bookmarks(IEnumerable<WordBookmark> items) #

Adds items to WordSection.Bookmarks: Gets all bookmarks defined in the section.

Parameters

items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordBookmark> required
The items, in order.

Returns

WordSectionScope The same scope.
Borders 2 overloads
public WordSectionScope Borders(WordBorder wordBorder) #

Applies border settings to the section.

Parameters

wordBorder OfficeIMO.Word.WordBorder required
Border preset to apply.

Returns

WordSectionScope The same scope.
public WordSectionScope Borders(Action<WordBorders> configure) #

Configures WordSection.Borders in place: Provides access to page border settings for this section.

Parameters

configure System.Action<OfficeIMO.Word.WordBorders> required
Configures the value.

Returns

WordSectionScope The same scope.
public WordSectionScope BreakType(WordSectionBreakType value) #

Sets WordSection.BreakType: Gets or sets how this section starts relative to the preceding section. An omitted section type uses WordSectionBreakType.NextPage.

Parameters

value OfficeIMO.Word.WordSectionBreakType required
The value.

Returns

WordSectionScope The same scope.
public WordSectionScope Chart(WordChart item) #

Adds an item to WordSection.Charts: Gets all charts contained in the section.

Parameters

item OfficeIMO.Word.WordChart required
The item.

Returns

WordSectionScope The same scope.
public WordSectionScope Charts(IEnumerable<WordChart> items) #

Adds items to WordSection.Charts: Gets all charts contained in the section.

Parameters

items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordChart> required
The items, in order.

Returns

WordSectionScope The same scope.
public WordSectionScope ColumnCount(int? value) #

Sets WordSection.ColumnCount: Gets or sets the number of columns in the section.

Parameters

value int? required
The value.

Returns

WordSectionScope The same scope.
public WordSectionScope ColumnDefinitions(IReadOnlyList<WordSectionColumn> value) #

Sets WordSection.ColumnDefinitions: Gets or replaces explicit section column widths and individual gaps. Setting a non-empty list selects unequal-width columns and synchronizes ColumnCount. An empty list restores equal-width columns while retaining their count and default gap. An omitted individual gap is zero for unequal columns; ColumnsSpace applies to equal widths. DOCX preserves the omission; native DOC writes its effective zero explicitly. Native DOC saving supports up to 44 columns, widths from 718 through 32767 twips, and gaps from zero through 32767 twips.

Parameters

value System.Collections.Generic.IReadOnlyList<OfficeIMO.Word.WordSectionColumn> required
The value.

Returns

WordSectionScope The same scope.
public WordSectionScope ColumnsSpace(OfficeLength? value) #

Sets WordSection.ColumnsSpace: Gets or sets the equal-width column gap as a physical length. Null omits the stored gap; layout uses its existing 36-point default. Storage rounds to whole signed 32-bit twips. Native DOC saving accepts only gaps from zero through 65535 twips and writes its default for an omitted gap when a column count is set. Individual unequal-column gaps are controlled by ColumnDefinitions.

Parameters

value OfficeIMO.OfficeLength? required
The value.

Returns

WordSectionScope The same scope.
Element 2 overloads
public WordSectionScope Element(WordElement item) #

Adds an item to WordSection.Elements: Provides a list of all elements within the section including paragraphs, tables, images, etc.

Parameters

item OfficeIMO.Word.WordElement required
The item.

Returns

WordSectionScope The same scope.
public WordSectionScope Element(Action<WordElement> configure) #

Creates an item, configures it and adds it to WordSection.Elements: Provides a list of all elements within the section including paragraphs, tables, images, etc.

Parameters

configure System.Action<OfficeIMO.Word.WordElement> required
Configures the new item before it is added.

Returns

WordSectionScope The same scope.
public WordSectionScope Elements(IEnumerable<WordElement> items) #

Adds items to WordSection.Elements: Provides a list of all elements within the section including paragraphs, tables, images, etc.

Parameters

items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordElement> required
The items, in order.

Returns

WordSectionScope The same scope.
public WordSectionScope Field(WordField item) #

Adds an item to WordSection.Fields: Gets all fields within the section.

Parameters

item OfficeIMO.Word.WordField required
The item.

Returns

WordSectionScope The same scope.
public WordSectionScope Fields(IEnumerable<WordField> items) #

Adds items to WordSection.Fields: Gets all fields within the section.

Parameters

items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordField> required
The items, in order.

Returns

WordSectionScope The same scope.
public WordSectionScope HasColumnSeparator(bool value = true) #

Sets WordSection.HasColumnSeparator: Gets or sets whether a separator line is shown between section columns.

Parameters

value bool = true optional
The value; true when omitted.

Returns

WordSectionScope The same scope.
public WordSectionScope Header(Action<WordHeaderScope> configure) #

Configures the section's default header, creating it when missing.

Parameters

configure System.Action<OfficeIMO.Word.WordHeaderScope> required
Composes the header.

Returns

WordSectionScope The same scope.
public WordSectionScope HorizontalLine(WordBorderStyle? lineType = null, OfficeColor? color = null, uint size = 12, uint space = 1, Action<WordParagraphScope>? configure = null) #

Inserts a horizontal line paragraph into the section.

Parameters

lineType OfficeIMO.Word.WordBorderStyle? = null optional
Border style of the line.
color OfficeIMO.OfficeColor? = null optional
Line color.
size uint = 12 optional
Line width.
space uint = 1 optional
Line spacing.
configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional
Configures the new item through its scope.

Returns

WordSectionScope The same scope.
HyperLink 2 overloads
public WordSectionScope Image(string path, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null, Action<WordImageScope>? configure = null) #

Adds an image to the section.

Parameters

path string required
Path to the image file to embed.
width OfficeIMO.OfficeLength? = null optional
Optional displayed image width.
height OfficeIMO.OfficeLength? = null optional
Optional displayed image height.
options OfficeIMO.Word.WordImageOptions? = null optional
Image markup, wrapping and metadata options.
configure System.Action<OfficeIMO.Word.WordImageScope>? = null optional
Configures the new item through its scope.

Returns

WordSectionScope The same scope.
public WordSectionScope PageSetup(Action<WordPageSetupScope> configure) #

Gets the page size, margins, orientation and running headers and footers of this section.

Parameters

configure System.Action<OfficeIMO.Word.WordPageSetupScope> required
Configures it through its scope.

Returns

WordSectionScope The same scope.
Paragraph 3 overloads
public WordSectionScope Paragraph(Action<WordParagraphScope> configure) #

Adds a paragraph at the end of the section and composes it.

Parameters

configure System.Action<OfficeIMO.Word.WordParagraphScope> required
Adds text runs and formats the paragraph.

Returns

WordSectionScope The same scope.
public WordSectionScope Paragraph(WordParagraph item) #

Adds an item to WordSection.Paragraphs: Provides a list of all paragraphs within the section

Parameters

item OfficeIMO.Word.WordParagraph required
The item.

Returns

WordSectionScope The same scope.
public WordSectionScope Paragraph(string text = "", Action<WordParagraphScope>? configure = null) #

Adds a new paragraph containing the specified text.

Parameters

text string = "" optional
Text to place in the paragraph.
configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional
Configures the new item through its scope.

Returns

WordSectionScope The same scope.
public WordSectionScope Paragraphs(IEnumerable<WordParagraph> items) #

Adds items to WordSection.Paragraphs: Provides a list of all paragraphs within the section

Parameters

items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordParagraph> required
The items, in order.

Returns

WordSectionScope The same scope.
public WordSectionScope RtlGutter(bool value = true) #

Sets WordSection.RtlGutter: Gets or sets a value indicating whether the gutter should be on the right for RTL pages.

Parameters

value bool = true optional
The value; true when omitted.

Returns

WordSectionScope The same scope.
public WordSectionScope Shape(WordShapeType shapeType, OfficeLength width, OfficeLength height, OfficeColor? fillColor = null, OfficeColor? strokeColor = null, OfficeLength? strokeWeight = null, double arcSize = 0.25, Action<WordShapeScope>? configure = null) #

Adds a VML shape to the section.

Parameters

shapeType OfficeIMO.Word.WordShapeType required
Type of shape to create.
width OfficeIMO.OfficeLength required
Width or line end X.
height OfficeIMO.OfficeLength required
Height or line end Y.
fillColor OfficeIMO.OfficeColor? = null optional
Fill color; white when omitted.
strokeColor OfficeIMO.OfficeColor? = null optional
Stroke color; black when omitted.
strokeWeight OfficeIMO.OfficeLength? = null optional
Stroke thickness; one point when omitted.
arcSize double = 0.25 optional
Rounded corner size expressed as a fraction between 0 and 1.
configure System.Action<OfficeIMO.Word.WordShapeScope>? = null optional
Configures the new item through its scope.

Returns

WordSectionScope The same scope.
public WordSectionScope SmartArt(WordSmartArtType type, Action<WordSmartArtScope>? configure = null) #

Inserts a SmartArt diagram into this section.

Parameters

type OfficeIMO.Word.WordSmartArtType required
Layout type of the SmartArt.
configure System.Action<OfficeIMO.Word.WordSmartArtScope>? = null optional
Configures the new item through its scope.

Returns

WordSectionScope The same scope.
Table 2 overloads
public WordSectionScope Table(Action<WordTableBuilder> compose) #

Adds a table composed row by row at the end of the section.

Parameters

compose System.Action<OfficeIMO.Word.WordTableBuilder> required
Sets the columns, header and rows.

Returns

WordSectionScope The same scope.
public WordSectionScope Table(int rows, int columns, WordTableStyle tableStyle = TableGrid, Action<WordTableScope>? configure = null) #

Adds a table to the section.

Parameters

rows int required
Number of rows.
columns int required
Number of columns.
tableStyle OfficeIMO.Word.WordTableStyle = TableGrid optional
Table style to apply.
configure System.Action<OfficeIMO.Word.WordTableScope>? = null optional
Configures the new item through its scope.

Returns

WordSectionScope The same scope.
public WordSectionScope TextBox(string text, WordImageTextWrapping wrapTextImage = Square, Action<WordTextBoxScope>? configure = null) #

Adds a text box paragraph to the section.

Parameters

text string required
Initial text inside the text box.
wrapTextImage OfficeIMO.Word.WordImageTextWrapping = Square optional
Wrapping style.
configure System.Action<OfficeIMO.Word.WordTextBoxScope>? = null optional
Configures the new item through its scope.

Returns

WordSectionScope The same scope.
public WordSectionScope Watermark(WordWatermarkStyle watermarkStyle, string textOrFilePath, OfficeLength? horizontalOffset = null, OfficeLength? verticalOffset = null, double scale = 1, Action<WordWatermarkScope>? configure = null) #

Adds a watermark to the section.

Parameters

watermarkStyle OfficeIMO.Word.WordWatermarkStyle required
Watermark style.
textOrFilePath string required
Text or image file path.
horizontalOffset OfficeIMO.OfficeLength? = null optional
Optional signed horizontal offset.
verticalOffset OfficeIMO.OfficeLength? = null optional
Optional signed vertical offset.
scale double = 1 optional
Scale factor for width and height.
configure System.Action<OfficeIMO.Word.WordWatermarkScope>? = null optional
Configures the new item through its scope.

Returns

WordSectionScope The same scope.

Properties

public WordSection Model { get; } #

The WordSection this scope edits, for plain C# inside a lambda.