WordDocumentScope
OfficeIMO.Word
Edits one 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
- Method WordDocumentScope.AutoUpdateToc
- Method WordDocumentScope.Background
- Method WordDocumentScope.Bookmark
- Method WordDocumentScope.Borders
- Method WordDocumentScope.Break
- Method WordDocumentScope.Callout
- Method WordDocumentScope.Chart
- Method WordDocumentScope.Charts
- Method WordDocumentScope.CodeBlock
- Method WordDocumentScope.CompatibilitySettings
- Method WordDocumentScope.CoverPageProperties
- Method WordDocumentScope.EndnoteSettings
- Method WordDocumentScope.Equation
- Method WordDocumentScope.Field
- Method WordDocumentScope.Footer
- Method WordDocumentScope.FootNote
- Method WordDocumentScope.FootNotes
- Method WordDocumentScope.FootnoteSettings
- Method WordDocumentScope.Header
- Method WordDocumentScope.Heading
- Method WordDocumentScope.HorizontalLine
- Method WordDocumentScope.HyperLink
- Method WordDocumentScope.Image
- Method WordDocumentScope.List
- Method WordDocumentScope.PageBreak
- Method WordDocumentScope.PageNumberSettings
- Method WordDocumentScope.PageSetup
- Method WordDocumentScope.Paragraph
- Method WordDocumentScope.Paragraphs
- Method WordDocumentScope.Properties
- Method WordDocumentScope.RtlGutter
- Method WordDocumentScope.Section
- Method WordDocumentScope.Sections
- Method WordDocumentScope.Settings
- Method WordDocumentScope.Shape
- Method WordDocumentScope.SmartArt
- Method WordDocumentScope.Table
- Method WordDocumentScope.TableOfContent
- Method WordDocumentScope.TableOfContents
- Method WordDocumentScope.TextBox
- Method WordDocumentScope.Theme
- Method WordDocumentScope.TrackChanges
- Method WordDocumentScope.VbaProject
Accepted by parameters 1
- Method WordDocument.Create
Methods
public WordDocumentScope ApplicationProperties(Action<WordApplicationProperties> configure) #Configures WordDocument.ApplicationProperties in place: Manages application related properties.
Parameters
- configure System.Action<OfficeIMO.Word.WordApplicationProperties>
- Configures the value.
public WordDocumentScope AutoUpdateToc(bool value = true) #Sets WordDocument.AutoUpdateToc: When true the table of contents is flagged to update before saving.
Parameters
- value bool = true
- The value; true when omitted.
public WordDocumentScope Background(WordBackground value) #Sets WordDocument.Background: Provides access to the document background settings.
Parameters
- value OfficeIMO.Word.WordBackground
- The value.
public WordDocumentScope Background(Action<WordBackground> configure) #Configures WordDocument.Background in place: Provides access to the document background settings.
Parameters
- configure System.Action<OfficeIMO.Word.WordBackground>
- Configures the value.
public WordDocumentScope Bookmark(string bookmarkName, Action<WordBookmarkScope>? configure = null) #Inserts a bookmark in a new paragraph.
Parameters
- bookmarkName string
- Name of the bookmark.
- configure System.Action<OfficeIMO.Word.WordBookmarkScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Borders(WordBorders value) #Sets WordDocument.Borders: Gets or sets the page borders for the first section.
Parameters
- value OfficeIMO.Word.WordBorders
- The value.
public WordDocumentScope Borders(Action<WordBorders> configure) #Configures WordDocument.Borders in place: Gets or sets the page borders for the first section.
Parameters
- configure System.Action<OfficeIMO.Word.WordBorders>
- Configures the value.
public WordDocumentScope Break(WordBreakType? breakType = null, Action<WordParagraphScope>? configure = null) #Inserts a break into the document.
Parameters
- breakType OfficeIMO.Word.WordBreakType? = null
- Type of break to insert.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Callout(OfficeCalloutKind kind, string title, string body, OfficeTheme? theme = null, Action<WordParagraphScope>? configure = null) #Adds a shaded callout title and body, returning its title paragraph.
Parameters
- kind OfficeIMO.OfficeCalloutKind
- The value.
- title string
- The value.
- body string
- The value.
- theme OfficeIMO.OfficeTheme? = null
- The value.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Chart(WordChart item) #Adds an item to WordDocument.Charts: Provides a list of the charts in the document body. WordDocument.AllCharts also lists header, footer, footnote and endnote charts.
Parameters
- item OfficeIMO.Word.WordChart
- The item.
public WordDocumentScope Chart(OfficeChartType chartKind, OfficeChartData data, OfficeChartOptions? options = null, Action<WordChartScope>? configure = null) #Creates an editable native chart and embedded worksheet from the shared OfficeIMO chart contract.
Parameters
- chartKind OfficeIMO.OfficeChartType
- Default chart family, with optional per-series kinds for supported combinations.
- data OfficeIMO.Drawing.OfficeChartData
- Categories, series, and their supported appearance.
- options OfficeIMO.OfficeChartOptions? = null
- Optional title, physical size and Word frame options. The default size is 600 by 600 pixels.
- configure System.Action<OfficeIMO.Word.WordChartScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Charts(IEnumerable<WordChart> items) #Adds items to WordDocument.Charts: Provides a list of the charts in the document body. WordDocument.AllCharts also lists header, footer, footnote and endnote charts.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordChart>
- The items, in order.
public WordDocumentScope CodeBlock(string code, string? language = null, Action<WordParagraphScope>? configure = null) #Adds a code paragraph using a named monospace paragraph style. The language is a descriptive hint.
Parameters
- code string
- The value.
- language string? = null
- The value.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordDocumentScope CompatibilitySettings(WordCompatibilitySettings value) #Sets WordDocument.CompatibilitySettings: Gets or sets compatibility settings for the document.
Parameters
- value OfficeIMO.Word.WordCompatibilitySettings
- The value.
public WordDocumentScope CompatibilitySettings(Action<WordCompatibilitySettings> configure) #Configures WordDocument.CompatibilitySettings in place: Gets or sets compatibility settings for the document.
Parameters
- configure System.Action<OfficeIMO.Word.WordCompatibilitySettings>
- Configures the value.
public WordDocumentScope CoverPageProperties(Action<WordCoverPageProperties> configure) #Configures WordDocument.CoverPageProperties in place: Provides access to the cover page properties custom XML part used by built-in templates.
Parameters
- configure System.Action<OfficeIMO.Word.WordCoverPageProperties>
- Configures the value.
public WordDocumentScope EndnoteSettings(Action<WordEndnoteSettings> configure) #Configures WordDocument.EndnoteSettings in place: Gets the editable configuration of the first section's endnote configuration.
Parameters
- configure System.Action<OfficeIMO.Word.WordEndnoteSettings>
- Configures the value.
public WordDocumentScope Equation(OfficeMathExpression expression, Action<WordEquationScope>? configure = null) #Adds an editable Word equation authored with the reusable OfficeIMO math model.
Parameters
- expression OfficeIMO.Drawing.OfficeMathExpression
- The value.
- configure System.Action<OfficeIMO.Word.WordEquationScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Equation(string omml, Action<WordEquationScope>? configure = null) #Inserts an equation specified in OMML format.
Parameters
- omml string
- OMML markup for the equation.
- configure System.Action<OfficeIMO.Word.WordEquationScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Field(WordFieldType wordFieldType, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false, List<string>? parameters = null, Action<WordFieldScope>? configure = null) #Adds a field to the document in a new paragraph.
Parameters
- wordFieldType OfficeIMO.Word.WordFieldType
- Type of field to insert.
- wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null
- Optional field format.
- customFormat string? = null
- Custom format string for date or time fields.
- advanced bool = false
- Whether to use advanced formatting.
- parameters System.Collections.Generic.List<string>? = null
- Additional switch parameters.
- configure System.Action<OfficeIMO.Word.WordFieldScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Field(WordFieldCode fieldCode, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false, Action<WordFieldScope>? configure = null) #Adds a field represented by a WordFieldCode to the document in a new paragraph.
Parameters
- fieldCode OfficeIMO.Word.WordFieldCode
- Field code instance describing instructions and switches.
- wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null
- Optional field format.
- customFormat string? = null
- Custom format string for date or time fields.
- advanced bool = false
- Whether to use advanced formatting.
- configure System.Action<OfficeIMO.Word.WordFieldScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Field(WordFieldBuilder builder, bool advanced = false, Action<WordFieldScope>? configure = null) #Adds a field built using WordFieldBuilder.
Parameters
- builder OfficeIMO.Word.WordFieldBuilder
- Field builder instance.
- advanced bool = false
- Whether to use advanced formatting.
- configure System.Action<OfficeIMO.Word.WordFieldScope>? = null
- Configures the new item through its scope.
public WordDocumentScope FootNote(WordFootNote item) #Adds an item to WordDocument.FootNotes: Collection of all footnotes referenced throughout the document.
Parameters
- item OfficeIMO.Word.WordFootNote
- The item.
public WordDocumentScope FootNotes(IEnumerable<WordFootNote> items) #Adds items to WordDocument.FootNotes: Collection of all footnotes referenced throughout the document.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordFootNote>
- The items, in order.
public WordDocumentScope FootnoteSettings(Action<WordFootnoteSettings> configure) #Configures WordDocument.FootnoteSettings in place: Gets the editable configuration of the first section's footnote configuration.
Parameters
- configure System.Action<OfficeIMO.Word.WordFootnoteSettings>
- Configures the value.
public WordDocumentScope Header(Action<WordHeaderScope> configure) #Configures the default header of the first section, creating it when missing.
Parameters
- configure System.Action<OfficeIMO.Word.WordHeaderScope>
- Composes the header.
public WordDocumentScope Heading(string text, int level = 1, Action<WordParagraphScope>? configure = null) #Adds a heading paragraph using the document's built-in heading style.
Parameters
- text string
- Heading text.
- level int = 1
- Heading level from one through nine.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordDocumentScope HorizontalLine(WordBorderStyle? lineType = null, OfficeColor? color = null, uint size = 12, uint space = 1, Action<WordParagraphScope>? configure = null) #Inserts a horizontal line into the document.
Parameters
- lineType OfficeIMO.Word.WordBorderStyle? = null
- Border style of the line.
- color OfficeIMO.OfficeColor? = null
- Line color.
- size uint = 12
- Line width in eighths of a point.
- space uint = 1
- Space above and below the line.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordDocumentScope HyperLink(string text, Uri uri, bool addStyle = false, string tooltip = "", bool history = true, Action<WordHyperLinkScope>? configure = null) #Adds a hyperlink pointing to an external URI.
Parameters
- text string
- Display text for the hyperlink.
- uri System.Uri
- Target URI.
- addStyle bool = false
- Whether to apply hyperlink style.
- tooltip string = ""
- Tooltip for the hyperlink.
- history bool = true
- Whether to track link history.
- configure System.Action<OfficeIMO.Word.WordHyperLinkScope>? = null
- Configures the new item through its scope.
public WordDocumentScope HyperLink(string text, string anchor, bool addStyle = false, string tooltip = "", bool history = true, Action<WordHyperLinkScope>? configure = null) #Adds an internal hyperlink pointing to a bookmark.
Parameters
- text string
- Display text for the hyperlink.
- anchor string
- Bookmark anchor.
- addStyle bool = false
- Whether to apply hyperlink style.
- tooltip string = ""
- Tooltip for the hyperlink.
- history bool = true
- Whether to track link history.
- configure System.Action<OfficeIMO.Word.WordHyperLinkScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Image(string path, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null, Action<WordImageScope>? configure = null) #Adds an image in a new paragraph and returns its editable occurrence.
Parameters
- path string
- The value.
- width OfficeIMO.OfficeLength? = null
- The value.
- height OfficeIMO.OfficeLength? = null
- The value.
- options OfficeIMO.Word.WordImageOptions? = null
- The value.
- configure System.Action<OfficeIMO.Word.WordImageScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Image(Stream stream, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null, Action<WordImageScope>? configure = null) #Adds an image stream in a new paragraph without disposing the caller's stream.
Parameters
- stream System.IO.Stream
- The value.
- width OfficeIMO.OfficeLength? = null
- The value.
- height OfficeIMO.OfficeLength? = null
- The value.
- options OfficeIMO.Word.WordImageOptions? = null
- The value.
- configure System.Action<OfficeIMO.Word.WordImageScope>? = null
- Configures the new item through its scope.
public WordDocumentScope List(WordListStyle style, Action<WordListScope>? configure = null) #Creates a list using one of the built-in numbering styles. For manually configured lists prefer WordDocument.AddCustomList.
Parameters
- style OfficeIMO.Word.WordListStyle
- The value.
- configure System.Action<OfficeIMO.Word.WordListScope>? = null
- Configures the new item through its scope.
public WordDocumentScope PageBreak(Action<WordParagraphScope>? configure = null) #Inserts a page break into the document.
Parameters
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordDocumentScope PageNumberSettings(Action<WordPageNumberSettings> configure) #Configures WordDocument.PageNumberSettings in place: Gets the editable configuration of the first section's page-numbering configuration.
Parameters
- configure System.Action<OfficeIMO.Word.WordPageNumberSettings>
- Configures the value.
public WordDocumentScope PageSetup(Action<WordPageSetupScope> configure) #Gets the page size, margins, orientation and running headers and footers of the first section.
Parameters
- configure System.Action<OfficeIMO.Word.WordPageSetupScope>
- Configures it through its scope.
public WordDocumentScope Paragraph(Action<WordParagraphScope> configure) #Adds a paragraph at the end of the document and composes it.
Parameters
- configure System.Action<OfficeIMO.Word.WordParagraphScope>
- Adds text runs and formats the paragraph.
public WordDocumentScope Paragraph(WordParagraph item) #Adds an item to WordDocument.Paragraphs: Returns all paragraphs from every section of the document.
Parameters
- item OfficeIMO.Word.WordParagraph
- The item.
public WordDocumentScope Paragraph(string text, Action<WordParagraphScope>? configure = null) #Adds a new paragraph containing the specified text.
Parameters
- text string
- Text for the paragraph.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Paragraphs(IEnumerable<WordParagraph> items) #Adds items to WordDocument.Paragraphs: Returns all paragraphs from every section of the document.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordParagraph>
- The items, in order.
public WordDocumentScope Properties(Action<WordBuiltinDocumentProperties> configure) #Configures WordDocument.Properties in place: Provides access to built-in document properties.
Parameters
- configure System.Action<OfficeIMO.Word.WordBuiltinDocumentProperties>
- Configures the value.
public WordDocumentScope RtlGutter(bool value = true) #Sets WordDocument.RtlGutter: 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
- The value; true when omitted.
public WordDocumentScope Section(WordSection item) #Adds an item to WordDocument.Sections: Collection of sections contained in the document.
Parameters
- item OfficeIMO.Word.WordSection
- The item.
public WordDocumentScope Section(WordSectionBreakType breakType, Action<WordSectionScope>? configure = null) #Adds a new section using the specified OfficeIMO break type.
Parameters
- breakType OfficeIMO.Word.WordSectionBreakType
- Section break type.
- configure System.Action<OfficeIMO.Word.WordSectionScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Section(Action<WordSectionScope>? configure = null) #Adds a new section using the document default break behavior.
Parameters
- configure System.Action<OfficeIMO.Word.WordSectionScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Sections(IEnumerable<WordSection> items) #Adds items to WordDocument.Sections: Collection of sections contained in the document.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordSection>
- The items, in order.
public WordDocumentScope Settings(Action<WordSettings> configure) #Configures WordDocument.Settings in place: Provides access to document settings. A missing settings part is created on first use.
Parameters
- configure System.Action<OfficeIMO.Word.WordSettings>
- Configures the value.
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) #Adds a basic shape to the document in a new paragraph.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- Type of shape to create.
- width OfficeIMO.OfficeLength
- Width or line end X.
- height OfficeIMO.OfficeLength
- Height or line end Y.
- fillColor OfficeIMO.OfficeColor? = null
- Fill color; white when omitted.
- strokeColor OfficeIMO.OfficeColor? = null
- Stroke color; black when omitted.
- strokeWeight OfficeIMO.OfficeLength? = null
- Stroke thickness; one point when omitted.
- arcSize double = 0.25
- Corner roundness fraction for rounded rectangles.
- configure System.Action<OfficeIMO.Word.WordShapeScope>? = null
- Configures the new item through its scope.
public WordDocumentScope SmartArt(WordSmartArtType type, Action<WordSmartArtScope>? configure = null) #Inserts a SmartArt diagram into the document.
Parameters
- type OfficeIMO.Word.WordSmartArtType
- Layout type of the SmartArt.
- configure System.Action<OfficeIMO.Word.WordSmartArtScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Table(Action<WordTableBuilder> compose) #Adds a table composed row by row at the end of the document.
Parameters
- compose System.Action<OfficeIMO.Word.WordTableBuilder>
- Sets the columns, header and rows.
public WordDocumentScope Table(IEnumerable<object?> items, OfficeTableOptions? options = null, Action<WordTableScope>? configure = null) #Adds a table from runtime objects by projecting their public properties or dictionary keys into columns.
Parameters
- items System.Collections.Generic.IEnumerable<object?>
- Objects to insert into the table. Column names come from the first item.
- options OfficeIMO.OfficeTableOptions? = null
- Column selection, ordering, header, formatting, alignment, name and caption options.
- configure System.Action<OfficeIMO.Word.WordTableScope>? = null
- Edits the created table.
public WordDocumentScope Table(int rows, int columns, WordTableStyle tableStyle = TableGrid, Action<WordTableScope>? configure = null) #Adds a table to the end of the document body.
Parameters
- rows int
- Number of rows to create.
- columns int
- Number of columns to create.
- tableStyle OfficeIMO.Word.WordTableStyle = TableGrid
- Optional table style to apply.
- configure System.Action<OfficeIMO.Word.WordTableScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Table(object?[,] values, OfficeTableOptions? options = null, Action<WordTableScope>? configure = null) #Adds an editable table from an existing rectangular matrix.
Parameters
- values object?[,]
- The value.
- options OfficeIMO.OfficeTableOptions? = null
- The value.
- configure System.Action<OfficeIMO.Word.WordTableScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Table(IEnumerable<string[]> rows, OfficeTableOptions? options = null, Action<WordTableScope>? configure = null) #Adds existing array rows as table cells. The first row is the header when headers are enabled.
Parameters
- rows System.Collections.Generic.IEnumerable<string[]>
- The value.
- options OfficeIMO.OfficeTableOptions? = null
- The value.
- configure System.Action<OfficeIMO.Word.WordTableScope>? = null
- Configures the new item through its scope.
public WordDocumentScope TableOfContent(Action<WordTableOfContent> configure) #Configures WordDocument.TableOfContent in place: Gets the table of contents defined in the document.
Parameters
- configure System.Action<OfficeIMO.Word.WordTableOfContent>
- Configures the value.
public WordDocumentScope TableOfContents(WordTableOfContentsStyle tableOfContentStyle = Template1, int minLevel = 1, int maxLevel = 3, string? title = null, bool insertAtTop = false, Action<WordTableOfContentScope>? configure = null) #Adds a table of contents to the current document.
Parameters
- tableOfContentStyle OfficeIMO.Word.WordTableOfContentsStyle = Template1
- Optional style to use when creating the table of contents.
- minLevel int = 1
- Minimum heading level to include (1..9).
- maxLevel int = 3
- Maximum heading level to include (1..9).
- title string? = null
- Optional title replacing the template title.
- insertAtTop bool = false
- Places the table of contents before existing body content.
- configure System.Action<OfficeIMO.Word.WordTableOfContentScope>? = null
- Configures the new item through its scope.
public WordDocumentScope TextBox(string text, WordImageTextWrapping wrapTextImage = Square, Action<WordTextBoxScope>? configure = null) #Inserts a text box into the document.
Parameters
- text string
- Initial text for the text box.
- wrapTextImage OfficeIMO.Word.WordImageTextWrapping = Square
- Text wrapping option.
- configure System.Action<OfficeIMO.Word.WordTextBoxScope>? = null
- Configures the new item through its scope.
public WordDocumentScope Theme(Action<WordTheme> configure) #Configures WordDocument.Theme in place: Gets the document theme: its colour scheme and its heading and body fonts.
Parameters
- configure System.Action<OfficeIMO.Word.WordTheme>
- Configures the value.
public WordDocumentScope TrackChanges(bool value = true) #Sets WordDocument.TrackChanges: Enable or disable tracking of all revisions, moves and formatting changes.
Parameters
- value bool = true
- The value; true when omitted.
public WordDocumentScope VbaProject(OfficeVbaProject project, OfficeVbaWriteOptions? options = null) #Applies a native source project while preserving Word's VBA data and requiring explicit signature removal.
Parameters
- project OfficeIMO.OfficeVbaProject
- The value.
- options OfficeIMO.OfficeVbaWriteOptions? = null
- The value.
Inherited Methods
Properties
public WordDocument Model { get; } #The WordDocument this scope edits, for plain C# inside a lambda.