# WordDocumentScope

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

Class 

`OfficeIMO.Word`

**Namespace**

`OfficeIMO.Word`

**Assembly**

`OfficeIMO.Word`

**Source revision**

`105ae88c45f6` with working tree changes

**Source**

[WordScopes.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordScopes.cs#L14)

**Modifiers**

sealed

Edits one [WordDocument](/api/word/officeimo-word-worddocument/): its fluent methods and keywords, each returning this scope.

## Inheritance

- object
- WordDocumentScope

## Usage

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

### Returned or exposed by 44

- Method [WordDocumentScope.ApplicationProperties](/api/word/officeimo-word-worddocumentscope/#method-applicationproperties-action-officeimo-word-wordapplicationproperties)
- Method [WordDocumentScope.AutoUpdateToc](/api/word/officeimo-word-worddocumentscope/#method-autoupdatetoc-boolean)
- Method [WordDocumentScope.Background](/api/word/officeimo-word-worddocumentscope/#method-background-officeimo-word-wordbackground)
- Method [WordDocumentScope.Bookmark](/api/word/officeimo-word-worddocumentscope/#method-bookmark-string-action-officeimo-word-wordbookmarkscope)
- Method [WordDocumentScope.Borders](/api/word/officeimo-word-worddocumentscope/#method-borders-action-officeimo-word-wordborders)
- Method [WordDocumentScope.Break](/api/word/officeimo-word-worddocumentscope/#method-break-nullable-officeimo-word-wordbreaktype-action-officeimo-word-wordparagraphscope)
- Method [WordDocumentScope.Callout](/api/word/officeimo-word-worddocumentscope/#method-callout-officeimo-officecalloutkind-string-string-officeimo-officetheme-action-officeimo-word-wordparagraphscope)
- Method [WordDocumentScope.Chart](/api/word/officeimo-word-worddocumentscope/#method-chart-officeimo-word-wordchart)
- Method [WordDocumentScope.Charts](/api/word/officeimo-word-worddocumentscope/#method-charts-collections-generic-ienumerable-officeimo-word-wordchart)
- Method [WordDocumentScope.CodeBlock](/api/word/officeimo-word-worddocumentscope/#method-codeblock-string-string-action-officeimo-word-wordparagraphscope)
- Method [WordDocumentScope.CompatibilitySettings](/api/word/officeimo-word-worddocumentscope/#method-compatibilitysettings-action-officeimo-word-wordcompatibilitysettings)
- Method [WordDocumentScope.CoverPageProperties](/api/word/officeimo-word-worddocumentscope/#method-coverpageproperties-action-officeimo-word-wordcoverpageproperties)
- Method [WordDocumentScope.EndnoteSettings](/api/word/officeimo-word-worddocumentscope/#method-endnotesettings-action-officeimo-word-wordendnotesettings)
- Method [WordDocumentScope.Equation](/api/word/officeimo-word-worddocumentscope/#method-equation-officeimo-drawing-officemathexpression-action-officeimo-word-wordequationscope)
- Method [WordDocumentScope.Field](/api/word/officeimo-word-worddocumentscope/#method-field-officeimo-word-wordfieldtype-nullable-officeimo-word-wordfieldformat-string-boolean-collections-generic-list-system-string-action-officeimo-word-wordfieldscope)
- Method [WordDocumentScope.Footer](/api/word/officeimo-word-worddocumentscope/#method-footer-action-officeimo-word-wordfooterscope)
- Method [WordDocumentScope.FootNote](/api/word/officeimo-word-worddocumentscope/#method-footnote-officeimo-word-wordfootnote)
- Method [WordDocumentScope.FootNotes](/api/word/officeimo-word-worddocumentscope/#method-footnotes-collections-generic-ienumerable-officeimo-word-wordfootnote)
- Method [WordDocumentScope.FootnoteSettings](/api/word/officeimo-word-worddocumentscope/#method-footnotesettings-action-officeimo-word-wordfootnotesettings)
- Method [WordDocumentScope.Header](/api/word/officeimo-word-worddocumentscope/#method-header-action-officeimo-word-wordheaderscope)
- Method [WordDocumentScope.Heading](/api/word/officeimo-word-worddocumentscope/#method-heading-string-int32-action-officeimo-word-wordparagraphscope)
- Method [WordDocumentScope.HorizontalLine](/api/word/officeimo-word-worddocumentscope/#method-horizontalline-nullable-officeimo-word-wordborderstyle-nullable-officeimo-officecolor-uint32-uint32-action-officeimo-word-wordparagraphscope)
- Method [WordDocumentScope.HyperLink](/api/word/officeimo-word-worddocumentscope/#method-hyperlink-string-string-boolean-string-boolean-action-officeimo-word-wordhyperlinkscope)
- Method [WordDocumentScope.Image](/api/word/officeimo-word-worddocumentscope/#method-image-string-nullable-officeimo-officelength-nullable-officeimo-officelength-officeimo-word-wordimageoptions-action-officeimo-word-wordimagescope)
- Method [WordDocumentScope.List](/api/word/officeimo-word-worddocumentscope/#method-list-officeimo-word-wordliststyle-action-officeimo-word-wordlistscope)
- Method [WordDocumentScope.PageBreak](/api/word/officeimo-word-worddocumentscope/#method-pagebreak-action-officeimo-word-wordparagraphscope)
- Method [WordDocumentScope.PageNumberSettings](/api/word/officeimo-word-worddocumentscope/#method-pagenumbersettings-action-officeimo-word-wordpagenumbersettings)
- Method [WordDocumentScope.PageSetup](/api/word/officeimo-word-worddocumentscope/#method-pagesetup-action-officeimo-word-wordpagesetupscope)
- Method [WordDocumentScope.Paragraph](/api/word/officeimo-word-worddocumentscope/#method-paragraph-action-officeimo-word-wordparagraphscope)
- Method [WordDocumentScope.Paragraphs](/api/word/officeimo-word-worddocumentscope/#method-paragraphs-collections-generic-ienumerable-officeimo-word-wordparagraph)
- Method [WordDocumentScope.Properties](/api/word/officeimo-word-worddocumentscope/#method-properties-action-officeimo-word-wordbuiltindocumentproperties)
- Method [WordDocumentScope.RtlGutter](/api/word/officeimo-word-worddocumentscope/#method-rtlgutter-boolean)
- Method [WordDocumentScope.Section](/api/word/officeimo-word-worddocumentscope/#method-section-officeimo-word-wordsectionbreaktype-action-officeimo-word-wordsectionscope)
- Method [WordDocumentScope.Sections](/api/word/officeimo-word-worddocumentscope/#method-sections-collections-generic-ienumerable-officeimo-word-wordsection)
- Method [WordDocumentScope.Settings](/api/word/officeimo-word-worddocumentscope/#method-settings-action-officeimo-word-wordsettings)
- Method [WordDocumentScope.Shape](/api/word/officeimo-word-worddocumentscope/#method-shape-officeimo-word-wordshapetype-officeimo-officelength-officeimo-officelength-nullable-officeimo-officecolor-nullable-officeimo-officecolor-nullable-officeimo-officelength-double-action-officeimo-word-wordshapescope)
- Method [WordDocumentScope.SmartArt](/api/word/officeimo-word-worddocumentscope/#method-smartart-officeimo-word-wordsmartarttype-action-officeimo-word-wordsmartartscope)
- Method [WordDocumentScope.Table](/api/word/officeimo-word-worddocumentscope/#method-table-object-0-0-officeimo-officetableoptions-action-officeimo-word-wordtablescope)
- Method [WordDocumentScope.TableOfContent](/api/word/officeimo-word-worddocumentscope/#method-tableofcontent-action-officeimo-word-wordtableofcontent)
- Method [WordDocumentScope.TableOfContents](/api/word/officeimo-word-worddocumentscope/#method-tableofcontents-officeimo-word-wordtableofcontentsstyle-int32-int32-string-boolean-action-officeimo-word-wordtableofcontentscope)
- Method [WordDocumentScope.TextBox](/api/word/officeimo-word-worddocumentscope/#method-textbox-string-officeimo-word-wordimagetextwrapping-action-officeimo-word-wordtextboxscope)
- Method [WordDocumentScope.Theme](/api/word/officeimo-word-worddocumentscope/#method-theme-action-officeimo-word-wordtheme)
- Method [WordDocumentScope.TrackChanges](/api/word/officeimo-word-worddocumentscope/#method-trackchanges-boolean)
- Method [WordDocumentScope.VbaProject](/api/word/officeimo-word-worddocumentscope/#method-vbaproject-officeimo-officevbaproject-officeimo-officevbawriteoptions)

### Accepted by parameters 1

- Method [WordDocument.Create](/api/word/officeimo-word-worddocument/#method-create-string-action-officeimo-word-worddocumentscope-officeimo-word-wordcreateoptions) parameter `compose`

Filter members 

Show inherited

## Methods

`public WordDocumentScope ApplicationProperties(Action<WordApplicationProperties> configure)` [#](#method-applicationproperties-action-officeimo-word-wordapplicationproperties)

Configures [WordDocument.ApplicationProperties](/api/word/officeimo-word-worddocument/) in place: Manages application related properties.

Parameters

**configure System.Action<OfficeIMO.Word.WordApplicationProperties> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope AutoUpdateToc(bool value = true)` [#](#method-autoupdatetoc-boolean)

Sets [WordDocument.AutoUpdateToc](/api/word/officeimo-word-worddocument/): When true the table of contents is flagged to update before saving.

Parameters

**value bool = true optional**

The value; true when omitted.

Returns

`WordDocumentScope` The same scope.

Background 2 overloads

`public WordDocumentScope Background(WordBackground value)` [#](#method-background-officeimo-word-wordbackground)

Sets [WordDocument.Background](/api/word/officeimo-word-worddocument/): Provides access to the document background settings.

Parameters

**value OfficeIMO.Word.WordBackground required**

The value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Background(Action<WordBackground> configure)` [#](#method-background-action-officeimo-word-wordbackground)

Configures [WordDocument.Background](/api/word/officeimo-word-worddocument/) in place: Provides access to the document background settings.

Parameters

**configure System.Action<OfficeIMO.Word.WordBackground> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Bookmark(string bookmarkName, Action<WordBookmarkScope>? configure = null)` [#](#method-bookmark-string-action-officeimo-word-wordbookmarkscope)

Inserts a bookmark in a new paragraph.

Parameters

**bookmarkName string required**

Name of the bookmark.

**configure System.Action<OfficeIMO.Word.WordBookmarkScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

Borders 2 overloads

`public WordDocumentScope Borders(WordBorders value)` [#](#method-borders-officeimo-word-wordborders)

Sets [WordDocument.Borders](/api/word/officeimo-word-worddocument/): Gets or sets the page borders for the first section.

Parameters

**value OfficeIMO.Word.WordBorders required**

The value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Borders(Action<WordBorders> configure)` [#](#method-borders-action-officeimo-word-wordborders)

Configures [WordDocument.Borders](/api/word/officeimo-word-worddocument/) in place: Gets or sets the page borders for the first section.

Parameters

**configure System.Action<OfficeIMO.Word.WordBorders> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Break(WordBreakType? breakType = null, Action<WordParagraphScope>? configure = null)` [#](#method-break-nullable-officeimo-word-wordbreaktype-action-officeimo-word-wordparagraphscope)

Inserts a break into the document.

Parameters

**breakType OfficeIMO.Word.WordBreakType? = null optional**

Type of break to insert.

**configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Callout(OfficeCalloutKind kind, string title, string body, OfficeTheme? theme = null, Action<WordParagraphScope>? configure = null)` [#](#method-callout-officeimo-officecalloutkind-string-string-officeimo-officetheme-action-officeimo-word-wordparagraphscope)

Adds a shaded callout title and body, returning its title paragraph.

Parameters

**kind OfficeIMO.OfficeCalloutKind required**

The value.

**title string required**

The value.

**body string required**

The value.

**theme OfficeIMO.OfficeTheme? = null optional**

The value.

**configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

Chart 2 overloads

`public WordDocumentScope Chart(WordChart item)` [#](#method-chart-officeimo-word-wordchart)

Adds an item to [WordDocument.Charts](/api/word/officeimo-word-worddocument/): Provides a list of the charts in the document body. [WordDocument.AllCharts](/api/word/officeimo-word-worddocument/) also lists header, footer, footnote and endnote charts.

Parameters

**item OfficeIMO.Word.WordChart required**

The item.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Chart(OfficeChartType chartKind, OfficeChartData data, OfficeChartOptions? options = null, Action<WordChartScope>? configure = null)` [#](#method-chart-officeimo-officecharttype-officeimo-drawing-officechartdata-officeimo-officechartoptions-action-officeimo-word-wordchartscope)

Creates an editable native chart and embedded worksheet from the shared OfficeIMO chart contract.

Parameters

**chartKind OfficeIMO.OfficeChartType required**

Default chart family, with optional per-series kinds for supported combinations.

**data OfficeIMO.Drawing.OfficeChartData required**

Categories, series, and their supported appearance.

**options OfficeIMO.OfficeChartOptions? = null optional**

Optional title, physical size and Word frame options. The default size is 600 by 600 pixels.

**configure System.Action<OfficeIMO.Word.WordChartScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Charts(IEnumerable<WordChart> items)` [#](#method-charts-collections-generic-ienumerable-officeimo-word-wordchart)

Adds items to [WordDocument.Charts](/api/word/officeimo-word-worddocument/): Provides a list of the charts in the document body. [WordDocument.AllCharts](/api/word/officeimo-word-worddocument/) also lists header, footer, footnote and endnote charts.

Parameters

**items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordChart> required**

The items, in order.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope CodeBlock(string code, string? language = null, Action<WordParagraphScope>? configure = null)` [#](#method-codeblock-string-string-action-officeimo-word-wordparagraphscope)

Adds a code paragraph using a named monospace paragraph style. The language is a descriptive hint.

Parameters

**code string required**

The value.

**language string? = null optional**

The value.

**configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

CompatibilitySettings 2 overloads

`public WordDocumentScope CompatibilitySettings(WordCompatibilitySettings value)` [#](#method-compatibilitysettings-officeimo-word-wordcompatibilitysettings)

Sets [WordDocument.CompatibilitySettings](/api/word/officeimo-word-worddocument/): Gets or sets compatibility settings for the document.

Parameters

**value OfficeIMO.Word.WordCompatibilitySettings required**

The value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope CompatibilitySettings(Action<WordCompatibilitySettings> configure)` [#](#method-compatibilitysettings-action-officeimo-word-wordcompatibilitysettings)

Configures [WordDocument.CompatibilitySettings](/api/word/officeimo-word-worddocument/) in place: Gets or sets compatibility settings for the document.

Parameters

**configure System.Action<OfficeIMO.Word.WordCompatibilitySettings> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope CoverPageProperties(Action<WordCoverPageProperties> configure)` [#](#method-coverpageproperties-action-officeimo-word-wordcoverpageproperties)

Configures [WordDocument.CoverPageProperties](/api/word/officeimo-word-worddocument/) in place: Provides access to the cover page properties custom XML part used by built-in templates.

Parameters

**configure System.Action<OfficeIMO.Word.WordCoverPageProperties> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope EndnoteSettings(Action<WordEndnoteSettings> configure)` [#](#method-endnotesettings-action-officeimo-word-wordendnotesettings)

Configures [WordDocument.EndnoteSettings](/api/word/officeimo-word-worddocument/) in place: Gets the editable configuration of the first section's endnote configuration.

Parameters

**configure System.Action<OfficeIMO.Word.WordEndnoteSettings> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

Equation 2 overloads

`public WordDocumentScope Equation(OfficeMathExpression expression, Action<WordEquationScope>? configure = null)` [#](#method-equation-officeimo-drawing-officemathexpression-action-officeimo-word-wordequationscope)

Adds an editable Word equation authored with the reusable OfficeIMO math model.

Parameters

**expression OfficeIMO.Drawing.OfficeMathExpression required**

The value.

**configure System.Action<OfficeIMO.Word.WordEquationScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Equation(string omml, Action<WordEquationScope>? configure = null)` [#](#method-equation-string-action-officeimo-word-wordequationscope)

Inserts an equation specified in OMML format.

Parameters

**omml string required**

OMML markup for the equation.

**configure System.Action<OfficeIMO.Word.WordEquationScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

Field 3 overloads

`public WordDocumentScope Field(WordFieldType wordFieldType, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false, List<string>? parameters = null, Action<WordFieldScope>? configure = null)` [#](#method-field-officeimo-word-wordfieldtype-nullable-officeimo-word-wordfieldformat-string-boolean-collections-generic-list-system-string-action-officeimo-word-wordfieldscope)

Adds a field to the document in a new paragraph.

Parameters

**wordFieldType OfficeIMO.Word.WordFieldType required**

Type of field to insert.

**wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null optional**

Optional field format.

**customFormat string? = null optional**

Custom format string for date or time fields.

**advanced bool = false optional**

Whether to use advanced formatting.

**parameters System.Collections.Generic.List<string>? = null optional**

Additional switch parameters.

**configure System.Action<OfficeIMO.Word.WordFieldScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Field(WordFieldCode fieldCode, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false, Action<WordFieldScope>? configure = null)` [#](#method-field-officeimo-word-wordfieldcode-nullable-officeimo-word-wordfieldformat-string-boolean-action-officeimo-word-wordfieldscope)

Adds a field represented by a [WordFieldCode](/api/word/officeimo-word-wordfieldcode/) to the document in a new paragraph.

Parameters

**fieldCode OfficeIMO.Word.WordFieldCode required**

Field code instance describing instructions and switches.

**wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null optional**

Optional field format.

**customFormat string? = null optional**

Custom format string for date or time fields.

**advanced bool = false optional**

Whether to use advanced formatting.

**configure System.Action<OfficeIMO.Word.WordFieldScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Field(WordFieldBuilder builder, bool advanced = false, Action<WordFieldScope>? configure = null)` [#](#method-field-officeimo-word-wordfieldbuilder-boolean-action-officeimo-word-wordfieldscope)

Adds a field built using [WordFieldBuilder](/api/word/officeimo-word-wordfieldbuilder/).

Parameters

**builder OfficeIMO.Word.WordFieldBuilder required**

Field builder instance.

**advanced bool = false optional**

Whether to use advanced formatting.

**configure System.Action<OfficeIMO.Word.WordFieldScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Footer(Action<WordFooterScope> configure)` [#](#method-footer-action-officeimo-word-wordfooterscope)

[WordScopes.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordScopes.cs#L23)

Configures the default footer of the first section, creating it when missing.

Parameters

**configure System.Action<OfficeIMO.Word.WordFooterScope> required**

Composes the footer.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope FootNote(WordFootNote item)` [#](#method-footnote-officeimo-word-wordfootnote)

Adds an item to [WordDocument.FootNotes](/api/word/officeimo-word-worddocument/): Collection of all footnotes referenced throughout the document.

Parameters

**item OfficeIMO.Word.WordFootNote required**

The item.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope FootNotes(IEnumerable<WordFootNote> items)` [#](#method-footnotes-collections-generic-ienumerable-officeimo-word-wordfootnote)

Adds items to [WordDocument.FootNotes](/api/word/officeimo-word-worddocument/): Collection of all footnotes referenced throughout the document.

Parameters

**items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordFootNote> required**

The items, in order.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope FootnoteSettings(Action<WordFootnoteSettings> configure)` [#](#method-footnotesettings-action-officeimo-word-wordfootnotesettings)

Configures [WordDocument.FootnoteSettings](/api/word/officeimo-word-worddocument/) in place: Gets the editable configuration of the first section's footnote configuration.

Parameters

**configure System.Action<OfficeIMO.Word.WordFootnoteSettings> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Header(Action<WordHeaderScope> configure)` [#](#method-header-action-officeimo-word-wordheaderscope)

[WordScopes.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordScopes.cs#L14)

Configures the default header of the first section, creating it when missing.

Parameters

**configure System.Action<OfficeIMO.Word.WordHeaderScope> required**

Composes the header.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Heading(string text, int level = 1, Action<WordParagraphScope>? configure = null)` [#](#method-heading-string-int32-action-officeimo-word-wordparagraphscope)

Adds a heading paragraph using the document's built-in heading style.

Parameters

**text string required**

Heading text.

**level int = 1 optional**

Heading level from one through nine.

**configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope HorizontalLine(WordBorderStyle? lineType = null, OfficeColor? color = null, uint size = 12, uint space = 1, Action<WordParagraphScope>? configure = null)` [#](#method-horizontalline-nullable-officeimo-word-wordborderstyle-nullable-officeimo-officecolor-uint32-uint32-action-officeimo-word-wordparagraphscope)

Inserts a horizontal line into the document.

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 in eighths of a point.

**space uint = 1 optional**

Space above and below the line.

**configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

HyperLink 2 overloads

`public WordDocumentScope HyperLink(string text, Uri uri, bool addStyle = false, string tooltip = "", bool history = true, Action<WordHyperLinkScope>? configure = null)` [#](#method-hyperlink-string-uri-boolean-string-boolean-action-officeimo-word-wordhyperlinkscope)

Adds a hyperlink pointing to an external URI.

Parameters

**text string required**

Display text for the hyperlink.

**uri System.Uri required**

Target URI.

**addStyle bool = false optional**

Whether to apply hyperlink style.

**tooltip string = "" optional**

Tooltip for the hyperlink.

**history bool = true optional**

Whether to track link history.

**configure System.Action<OfficeIMO.Word.WordHyperLinkScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope HyperLink(string text, string anchor, bool addStyle = false, string tooltip = "", bool history = true, Action<WordHyperLinkScope>? configure = null)` [#](#method-hyperlink-string-string-boolean-string-boolean-action-officeimo-word-wordhyperlinkscope)

Adds an internal hyperlink pointing to a bookmark.

Parameters

**text string required**

Display text for the hyperlink.

**anchor string required**

Bookmark anchor.

**addStyle bool = false optional**

Whether to apply hyperlink style.

**tooltip string = "" optional**

Tooltip for the hyperlink.

**history bool = true optional**

Whether to track link history.

**configure System.Action<OfficeIMO.Word.WordHyperLinkScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

Image 2 overloads

`public WordDocumentScope Image(string path, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null, Action<WordImageScope>? configure = null)` [#](#method-image-string-nullable-officeimo-officelength-nullable-officeimo-officelength-officeimo-word-wordimageoptions-action-officeimo-word-wordimagescope)

Adds an image in a new paragraph and returns its editable occurrence.

Parameters

**path string required**

The value.

**width OfficeIMO.OfficeLength? = null optional**

The value.

**height OfficeIMO.OfficeLength? = null optional**

The value.

**options OfficeIMO.Word.WordImageOptions? = null optional**

The value.

**configure System.Action<OfficeIMO.Word.WordImageScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Image(Stream stream, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null, Action<WordImageScope>? configure = null)` [#](#method-image-io-stream-nullable-officeimo-officelength-nullable-officeimo-officelength-officeimo-word-wordimageoptions-action-officeimo-word-wordimagescope)

Adds an image stream in a new paragraph without disposing the caller's stream.

Parameters

**stream System.IO.Stream required**

The value.

**width OfficeIMO.OfficeLength? = null optional**

The value.

**height OfficeIMO.OfficeLength? = null optional**

The value.

**options OfficeIMO.Word.WordImageOptions? = null optional**

The value.

**configure System.Action<OfficeIMO.Word.WordImageScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope List(WordListStyle style, Action<WordListScope>? configure = null)` [#](#method-list-officeimo-word-wordliststyle-action-officeimo-word-wordlistscope)

Creates a list using one of the built-in numbering styles. For manually configured lists prefer [WordDocument.AddCustomList](/api/word/officeimo-word-worddocument/).

Parameters

**style OfficeIMO.Word.WordListStyle required**

The value.

**configure System.Action<OfficeIMO.Word.WordListScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope PageBreak(Action<WordParagraphScope>? configure = null)` [#](#method-pagebreak-action-officeimo-word-wordparagraphscope)

Inserts a page break into the document.

Parameters

**configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope PageNumberSettings(Action<WordPageNumberSettings> configure)` [#](#method-pagenumbersettings-action-officeimo-word-wordpagenumbersettings)

Configures [WordDocument.PageNumberSettings](/api/word/officeimo-word-worddocument/) in place: Gets the editable configuration of the first section's page-numbering configuration.

Parameters

**configure System.Action<OfficeIMO.Word.WordPageNumberSettings> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope PageSetup(Action<WordPageSetupScope> configure)` [#](#method-pagesetup-action-officeimo-word-wordpagesetupscope)

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

Parameters

**configure System.Action<OfficeIMO.Word.WordPageSetupScope> required**

Configures it through its scope.

Returns

`WordDocumentScope` The same scope.

Paragraph 3 overloads

`public WordDocumentScope Paragraph(Action<WordParagraphScope> configure)` [#](#method-paragraph-action-officeimo-word-wordparagraphscope)

[WordScopes.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordScopes.cs#L32)

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

Parameters

**configure System.Action<OfficeIMO.Word.WordParagraphScope> required**

Adds text runs and formats the paragraph.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Paragraph(WordParagraph item)` [#](#method-paragraph-officeimo-word-wordparagraph)

Adds an item to [WordDocument.Paragraphs](/api/word/officeimo-word-worddocument/): Returns all paragraphs from every section of the document.

Parameters

**item OfficeIMO.Word.WordParagraph required**

The item.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Paragraph(string text, Action<WordParagraphScope>? configure = null)` [#](#method-paragraph-string-action-officeimo-word-wordparagraphscope)

Adds a new paragraph containing the specified text.

Parameters

**text string required**

Text for the paragraph.

**configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Paragraphs(IEnumerable<WordParagraph> items)` [#](#method-paragraphs-collections-generic-ienumerable-officeimo-word-wordparagraph)

Adds items to [WordDocument.Paragraphs](/api/word/officeimo-word-worddocument/): Returns all paragraphs from every section of the document.

Parameters

**items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordParagraph> required**

The items, in order.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Properties(Action<WordBuiltinDocumentProperties> configure)` [#](#method-properties-action-officeimo-word-wordbuiltindocumentproperties)

Configures [WordDocument.Properties](/api/word/officeimo-word-worddocument/) in place: Provides access to built-in document properties.

Parameters

**configure System.Action<OfficeIMO.Word.WordBuiltinDocumentProperties> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope RtlGutter(bool value = true)` [#](#method-rtlgutter-boolean)

Sets [WordDocument.RtlGutter](/api/word/officeimo-word-worddocument/): Gets or sets a value indicating whether the gutter should appear on the right for right-to-left pages in the first section.

Parameters

**value bool = true optional**

The value; true when omitted.

Returns

`WordDocumentScope` The same scope.

Section 3 overloads

`public WordDocumentScope Section(WordSection item)` [#](#method-section-officeimo-word-wordsection)

Adds an item to [WordDocument.Sections](/api/word/officeimo-word-worddocument/): Collection of sections contained in the document.

Parameters

**item OfficeIMO.Word.WordSection required**

The item.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Section(WordSectionBreakType breakType, Action<WordSectionScope>? configure = null)` [#](#method-section-officeimo-word-wordsectionbreaktype-action-officeimo-word-wordsectionscope)

Adds a new section using the specified OfficeIMO break type.

Parameters

**breakType OfficeIMO.Word.WordSectionBreakType required**

Section break type.

**configure System.Action<OfficeIMO.Word.WordSectionScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Section(Action<WordSectionScope>? configure = null)` [#](#method-section-action-officeimo-word-wordsectionscope)

Adds a new section using the document default break behavior.

Parameters

**configure System.Action<OfficeIMO.Word.WordSectionScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Sections(IEnumerable<WordSection> items)` [#](#method-sections-collections-generic-ienumerable-officeimo-word-wordsection)

Adds items to [WordDocument.Sections](/api/word/officeimo-word-worddocument/): Collection of sections contained in the document.

Parameters

**items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordSection> required**

The items, in order.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Settings(Action<WordSettings> configure)` [#](#method-settings-action-officeimo-word-wordsettings)

Configures [WordDocument.Settings](/api/word/officeimo-word-worddocument/) in place: Provides access to document settings. A missing settings part is created on first use.

Parameters

**configure System.Action<OfficeIMO.Word.WordSettings> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Shape(WordShapeType shapeType, OfficeLength width, OfficeLength height, OfficeColor? fillColor = null, OfficeColor? strokeColor = null, OfficeLength? strokeWeight = null, double arcSize = 0.25, Action<WordShapeScope>? configure = null)` [#](#member-6ece5e52741d190c10fa06dc)

Adds a basic shape to the document in a new paragraph.

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**

Corner roundness fraction for rounded rectangles.

**configure System.Action<OfficeIMO.Word.WordShapeScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope SmartArt(WordSmartArtType type, Action<WordSmartArtScope>? configure = null)` [#](#method-smartart-officeimo-word-wordsmartarttype-action-officeimo-word-wordsmartartscope)

Inserts a SmartArt diagram into the document.

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

`WordDocumentScope` The same scope.

Table 5 overloads

`public WordDocumentScope Table(Action<WordTableBuilder> compose)` [#](#method-table-action-officeimo-word-wordtablebuilder)

[WordScopes.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordScopes.cs#L41)

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

Parameters

**compose System.Action<OfficeIMO.Word.WordTableBuilder> required**

Sets the columns, header and rows.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Table(IEnumerable<object?> items, OfficeTableOptions? options = null, Action<WordTableScope>? configure = null)` [#](#method-table-collections-generic-ienumerable-system-object-officeimo-officetableoptions-action-officeimo-word-wordtablescope)

[WordScopes.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordScopes.cs#L54)

Adds a table from runtime objects by projecting their public properties or dictionary keys into columns.

Parameters

**items System.Collections.Generic.IEnumerable<object?> required**

Objects to insert into the table. Column names come from the first item.

**options OfficeIMO.OfficeTableOptions? = null optional**

Column selection, ordering, header, formatting, alignment, name and caption options.

**configure System.Action<OfficeIMO.Word.WordTableScope>? = null optional**

Edits the created table.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Table(int rows, int columns, WordTableStyle tableStyle = TableGrid, Action<WordTableScope>? configure = null)` [#](#method-table-int32-int32-officeimo-word-wordtablestyle-action-officeimo-word-wordtablescope)

Adds a table to the end of the document body.

Parameters

**rows int required**

Number of rows to create.

**columns int required**

Number of columns to create.

**tableStyle OfficeIMO.Word.WordTableStyle = TableGrid optional**

Optional table style to apply.

**configure System.Action<OfficeIMO.Word.WordTableScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Table(object?[,] values, OfficeTableOptions? options = null, Action<WordTableScope>? configure = null)` [#](#method-table-object-0-0-officeimo-officetableoptions-action-officeimo-word-wordtablescope)

Adds an editable table from an existing rectangular matrix.

Parameters

**values object?[,] required**

The value.

**options OfficeIMO.OfficeTableOptions? = null optional**

The value.

**configure System.Action<OfficeIMO.Word.WordTableScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Table(IEnumerable<string[]> rows, OfficeTableOptions? options = null, Action<WordTableScope>? configure = null)` [#](#method-table-collections-generic-ienumerable-system-string-officeimo-officetableoptions-action-officeimo-word-wordtablescope)

Adds existing array rows as table cells. The first row is the header when headers are enabled.

Parameters

**rows System.Collections.Generic.IEnumerable<string[]> required**

The value.

**options OfficeIMO.OfficeTableOptions? = null optional**

The value.

**configure System.Action<OfficeIMO.Word.WordTableScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope TableOfContent(Action<WordTableOfContent> configure)` [#](#method-tableofcontent-action-officeimo-word-wordtableofcontent)

Configures [WordDocument.TableOfContent](/api/word/officeimo-word-worddocument/) in place: Gets the table of contents defined in the document.

Parameters

**configure System.Action<OfficeIMO.Word.WordTableOfContent> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope TableOfContents(WordTableOfContentsStyle tableOfContentStyle = Template1, int minLevel = 1, int maxLevel = 3, string? title = null, bool insertAtTop = false, Action<WordTableOfContentScope>? configure = null)` [#](#method-tableofcontents-officeimo-word-wordtableofcontentsstyle-int32-int32-string-boolean-action-officeimo-word-wordtableofcontentscope)

Adds a table of contents to the current document.

Parameters

**tableOfContentStyle OfficeIMO.Word.WordTableOfContentsStyle = Template1 optional**

Optional style to use when creating the table of contents.

**minLevel int = 1 optional**

Minimum heading level to include (1..9).

**maxLevel int = 3 optional**

Maximum heading level to include (1..9).

**title string? = null optional**

Optional title replacing the template title.

**insertAtTop bool = false optional**

Places the table of contents before existing body content.

**configure System.Action<OfficeIMO.Word.WordTableOfContentScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope TextBox(string text, WordImageTextWrapping wrapTextImage = Square, Action<WordTextBoxScope>? configure = null)` [#](#method-textbox-string-officeimo-word-wordimagetextwrapping-action-officeimo-word-wordtextboxscope)

Inserts a text box into the document.

Parameters

**text string required**

Initial text for the text box.

**wrapTextImage OfficeIMO.Word.WordImageTextWrapping = Square optional**

Text wrapping option.

**configure System.Action<OfficeIMO.Word.WordTextBoxScope>? = null optional**

Configures the new item through its scope.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope Theme(Action<WordTheme> configure)` [#](#method-theme-action-officeimo-word-wordtheme)

Configures [WordDocument.Theme](/api/word/officeimo-word-worddocument/) in place: Gets the document theme: its colour scheme and its heading and body fonts.

Parameters

**configure System.Action<OfficeIMO.Word.WordTheme> required**

Configures the value.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope TrackChanges(bool value = true)` [#](#method-trackchanges-boolean)

Sets [WordDocument.TrackChanges](/api/word/officeimo-word-worddocument/): Enable or disable tracking of all revisions, moves and formatting changes.

Parameters

**value bool = true optional**

The value; true when omitted.

Returns

`WordDocumentScope` The same scope.

`public WordDocumentScope VbaProject(OfficeVbaProject project, OfficeVbaWriteOptions? options = null)` [#](#method-vbaproject-officeimo-officevbaproject-officeimo-officevbawriteoptions)

Applies a native source project while preserving Word's VBA data and requiring explicit signature removal.

Parameters

**project OfficeIMO.OfficeVbaProject required**

The value.

**options OfficeIMO.OfficeVbaWriteOptions? = null optional**

The value.

Returns

`WordDocumentScope` The same scope.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public WordDocument Model { get; }` [#](#property-model)

The [WordDocument](/api/word/officeimo-word-worddocument/) this scope edits, for plain C# inside a lambda.

<!-- PowerForge markdown artifact sha256:04BB2A06CFC62E0792C50D8701373B85030580AC8AF5AB7D9DA9F3F214DF5E30 -->
