WordParagraph
OfficeIMO.Word
Represents a paragraph within a Word document.
Inheritance
- WordElement
- WordParagraph
Usage
Explore 234 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 190
- Property WordBookmark.Paragraph
- Extension method WordDocument.AddParagraphFromXml
- Method WordDocument.AddBreak
- Method WordDocument.AddCallout
- Method WordDocument.AddCodeBlock
- Method WordDocument.AddHeading
- Method WordDocument.AddHorizontalLine
- Method WordDocument.AddPageBreak
- Method WordDocument.AddParagraph
- Method WordDocument.InsertParagraphAt
- Property WordDocument.Paragraphs
- Property WordDocument.ParagraphsBookmarks
- Property WordDocument.ParagraphsBreaks
- Property WordDocument.ParagraphsCharts
- Property WordDocument.ParagraphsCheckBoxes
- Property WordDocument.ParagraphsComboBoxes
- Property WordDocument.ParagraphsDatePickers
- Property WordDocument.ParagraphsDropDownLists
- Property WordDocument.ParagraphsEmbeddedObjects
- Property WordDocument.ParagraphsEndNotes
- Property WordDocument.ParagraphsEquations
- Property WordDocument.ParagraphsFields
- Property WordDocument.ParagraphsFootNotes
- Property WordDocument.ParagraphsHyperLinks
- Property WordDocument.ParagraphsImages
- Property WordDocument.ParagraphsPageBreaks
- Property WordDocument.ParagraphsPictureControls
- Property WordDocument.ParagraphsRepeatingSections
- Property WordDocument.ParagraphsShapes
- Property WordDocument.ParagraphsSmartArts
- Property WordDocument.ParagraphsStructuredDocumentTags
- Property WordDocument.ParagraphsTabs
- Property WordDocument.ParagraphsTabStops
- Property WordDocument.ParagraphsTextBoxes
- Property WordEmbeddedObject.Paragraph
- Property WordEndNote.Paragraph
- Property WordEndNote.Paragraphs
- Property WordEndNote.ParentParagraph
- Property WordEquation.Paragraph
- Property WordField.Paragraph
- Method WordFooter.AddHorizontalLine
- Method WordFooter.AddPageNumber
- Method WordFooter.AddParagraph
- Property WordFooter.Paragraphs
- Property WordFooter.ParagraphsBookmarks
- Property WordFooter.ParagraphsCheckBoxes
- Property WordFooter.ParagraphsDatePickers
- Property WordFooter.ParagraphsDropDownLists
- Property WordFooter.ParagraphsEquations
- Property WordFooter.ParagraphsFields
- Property WordFooter.ParagraphsHyperLinks
- Property WordFooter.ParagraphsImages
- Property WordFooter.ParagraphsPageBreaks
- Property WordFooter.ParagraphsRepeatingSections
- Property WordFooter.ParagraphsSmartArts
- Property WordFooter.ParagraphsStructuredDocumentTags
- Property WordFootNote.Paragraph
- Property WordFootNote.Paragraphs
- Property WordFootNote.ParentParagraph
- Method WordHeader.AddHorizontalLine
- Method WordHeader.AddPageNumber
- Method WordHeader.AddParagraph
- Property WordHeader.Paragraphs
- Property WordHeader.ParagraphsBookmarks
- Property WordHeader.ParagraphsCheckBoxes
- Property WordHeader.ParagraphsDatePickers
- Property WordHeader.ParagraphsDropDownLists
- Property WordHeader.ParagraphsEquations
- Property WordHeader.ParagraphsFields
- Property WordHeader.ParagraphsHyperLinks
- Property WordHeader.ParagraphsImages
- Property WordHeader.ParagraphsPageBreaks
- Property WordHeader.ParagraphsRepeatingSections
- Property WordHeader.ParagraphsSmartArts
- Property WordHeader.ParagraphsStructuredDocumentTags
- Method WordHeaderFooter.AddHorizontalLine
- Method WordHeaderFooter.AddPageNumber
- Method WordHeaderFooter.AddParagraph
- Property WordHeaderFooter.Paragraphs
- Property WordHeaderFooter.ParagraphsBookmarks
- Property WordHeaderFooter.ParagraphsCheckBoxes
- Property WordHeaderFooter.ParagraphsDatePickers
- Property WordHeaderFooter.ParagraphsDropDownLists
- Property WordHeaderFooter.ParagraphsEquations
- Property WordHeaderFooter.ParagraphsFields
- Property WordHeaderFooter.ParagraphsHyperLinks
- Property WordHeaderFooter.ParagraphsImages
- Property WordHeaderFooter.ParagraphsPageBreaks
- Property WordHeaderFooter.ParagraphsRepeatingSections
- Property WordHeaderFooter.ParagraphsSmartArts
- Property WordHeaderFooter.ParagraphsStructuredDocumentTags
- Property WordHyperLink.Paragraph
- Property WordHyperLink.Runs
- Property WordImage.Paragraph
- Method WordList.AddItem
- Method WordList.AddLinkItem
- Method WordList.AddTaskItem
- Property WordList.ListItems
- Method WordPageNumber.AppendText
- Property WordPageNumber.Paragraph
- Property WordPageNumber.Paragraphs
- Method WordPaperStyle.AddCallout
- Method WordPaperStyle.AddCover
- Method WordPaperStyle.AddNote
- Method WordPaperStyle.AddPageChrome
- Method WordParagraph.AddBreak
- Method WordParagraph.AddDeletedText
- Method WordParagraph.AddFormattedText
- Method WordParagraph.AddHorizontalLine
- Method WordParagraph.AddInsertedText
- Method WordParagraph.AddPageNumber
- Method WordParagraph.AddParagraph
- Method WordParagraph.AddParagraphAfterSelf
- Method WordParagraph.AddParagraphBeforeSelf
- Method WordParagraph.AddTab
- Method WordParagraph.AddText
- Method WordParagraph.ClearTabStops
- Method WordParagraph.GetRuns
- Method WordParagraph.SetAlignment
- Method WordParagraph.SetBackgroundColor
- Method WordParagraph.SetBold
- Method WordParagraph.SetCapsStyle
- Method WordParagraph.SetCharacterStyle
- Method WordParagraph.SetCharacterStyleId
- Method WordParagraph.SetColor
- Method WordParagraph.SetDoubleStrikethrough
- Method WordParagraph.SetEmboss
- Method WordParagraph.SetFontFamily
- Method WordParagraph.SetFontSize
- Method WordParagraph.SetHighlight
- Method WordParagraph.SetItalic
- Method WordParagraph.SetLanguage
- Method WordParagraph.SetOutline
- Method WordParagraph.SetShadow
- Method WordParagraph.SetSmallCaps
- Method WordParagraph.SetSpacing
- Method WordParagraph.SetStrikethrough
- Method WordParagraph.SetStyle
- Method WordParagraph.SetStyleId
- Method WordParagraph.SetSubscript
- Method WordParagraph.SetSuperscript
- Method WordParagraph.SetText
- Method WordParagraph.SetUnderline
- Method WordParagraph.SetVerticalTextAlignment
- Method WordParagraph.TransformTextCase
- Property WordSearchResult.BodyParagraphs
- Property WordSearchResult.DefaultFooterParagraphs
- Property WordSearchResult.DefaultHeaderParagraphs
- Property WordSearchResult.EndnoteParagraphs
- Property WordSearchResult.EvenPageFooterParagraphs
- Property WordSearchResult.EvenPageHeaderParagraphs
- Property WordSearchResult.FirstPageFooterParagraphs
- Property WordSearchResult.FirstPageHeaderParagraphs
- Property WordSearchResult.FootnoteParagraphs
- Property WordSearchResult.Paragraphs
- Property WordSearchResult.TableParagraphs
- Method WordSection.AddFooterParagraph
- Method WordSection.AddHeaderParagraph
- Method WordSection.AddHorizontalLine
- Method WordSection.AddParagraph
- Property WordSection.Paragraphs
- Property WordSection.ParagraphsBookmarks
- Property WordSection.ParagraphsBreaks
- Property WordSection.ParagraphsCharts
- Property WordSection.ParagraphsCheckBoxes
- Property WordSection.ParagraphsComboBoxes
- Property WordSection.ParagraphsDatePickers
- Property WordSection.ParagraphsDropDownLists
- Property WordSection.ParagraphsEmbeddedObjects
- Property WordSection.ParagraphsEndNotes
- Property WordSection.ParagraphsEquations
- Property WordSection.ParagraphsFields
- Property WordSection.ParagraphsFootNotes
- Property WordSection.ParagraphsHyperLinks
- Property WordSection.ParagraphsImages
- Property WordSection.ParagraphsPageBreaks
- Property WordSection.ParagraphsPictureControls
- Property WordSection.ParagraphsRepeatingSections
- Property WordSection.ParagraphsShapes
- Property WordSection.ParagraphsSmartArts
- Property WordSection.ParagraphsStructuredDocumentTags
- Property WordSection.ParagraphsTabs
- Property WordSection.ParagraphsTabStops
- Property WordSection.ParagraphsTextBoxes
- Property WordTable.Paragraphs
- Method WordTableCell.AddParagraph
- Property WordTableCell.Paragraphs
- Property WordTableOfContent.TitleParagraph
- Property WordTextBox.Paragraphs
- Method WordXmlExtensions.AddParagraphFromXml
Accepted by parameters 44
- Method WordBookmark.AddBookmark
- Constructor WordChart.WordChart
- Method WordDocument.AcceptRevisionsInParagraph
- Method WordDocument.AddEmbeddedFragmentAfter
- Method WordDocument.AddParagraph
- Method WordDocument.InsertParagraphAt
- Method WordDocument.InsertTableAfter
- Method WordDocument.RejectRevisionsInParagraph
- Method WordDocument.ReplaceAll
- Method WordDocument.ReplaceAll
- Constructor WordEmbeddedObject.WordEmbeddedObject
- Method WordField.AddField
- Method WordHyperLink.AddHyperLink
- Method WordHyperLink.AddHyperLink
- Method WordImage.Clone
- Constructor WordList.WordList
- Method WordList.AddItem
- Method WordList.Clone
- Extension method WordParagraph.ToXml
- Method WordParagraph.AddParagraph
- Method WordParagraph.AddParagraphAfterSelf
- Method WordParagraph.Equals
- Method WordParagraph.op_Equality
- Method WordParagraph.op_Equality
- Method WordParagraph.op_Inequality
- Method WordParagraph.op_Inequality
- Method WordRange.AddComment
- Method WordRange.Format
- Method WordRange.Replace
- Method WordShape.AddDrawingShape
- Method WordShape.AddDrawingShapeAnchored
- Method WordShape.AddEllipse
- Method WordShape.AddLine
- Method WordShape.AddPolygon
- Method WordShape.AddRoundedRectangle
- Method WordTable.Clone
- Method WordTable.ConditionalFormatting
- Method WordTable.ConditionalFormatting
- Method WordTableCell.AddParagraph
- Method WordTableConditionalFormattingBuilder.AddRule
- Method WordTableConditionalFormattingBuilder.AddRule
- Constructor WordTabStop.WordTabStop
- Constructor WordTextBox.WordTextBox
- Method WordXmlExtensions.ToXml
Constructors
public WordParagraph(WordDocument? document = null, bool newParagraph = true, bool newRun = true) #Initializes a new paragraph.
Parameters
- document OfficeIMO.Word.WordDocument? = null
- Parent document.
- newParagraph bool = true
- Create a new paragraph element.
- newRun bool = true
- Create a new run inside the paragraph.
Methods
public WordBookmark AddBookmark(string bookmarkName) #Add bookmark to a word document proceeding from the paragraph this was called on.
Parameters
- bookmarkName string
- The name of the bookmark.
public WordParagraph AddBreak(WordBreakType? breakType = null) #Add Break to the paragraph. By default it adds soft break (SHIFT+ENTER)
Parameters
- breakType OfficeIMO.Word.WordBreakType? = null
- Optional argument to add a specific type of break.
public WordChart AddChart(string title = "", bool roundedCorners = false, OfficeLength? width = null, OfficeLength? height = null) #Adds the chart to the document. The type of chart is determined by the type of data passed in. You can use multiple: .AddBar() to add a bar chart .AddLine() to add a line chart .AddPie() to add a pie chart .AddArea() to add an area chart .AddScatter() to add a scatter chart .AddRadar() to add a radar chart .AddBar3D() to add a 3-D bar chart. .AddPie3D() to add a 3-D pie chart. .AddLine3D() to add a 3-D line chart. You can't mix and match the types of charts, except bar and line which can coexist in a combo chart.
Parameters
- title string = ""
- The title.
- roundedCorners bool = false
- if set to true [rounded corners].
- width OfficeIMO.OfficeLength? = null
- The width.
- height OfficeIMO.OfficeLength? = null
- The height.
public WordChart AddChart(OfficeChartType chartKind, OfficeChartData data) #Adds an editable native chart with the format's default title, size and placement.
Parameters
- chartKind OfficeIMO.OfficeChartType
- data OfficeIMO.Drawing.OfficeChartData
Returns
WordChartpublic WordChart AddChart(OfficeChartType chartKind, OfficeChartData data, OfficeChartOptions? options) #Inserts an editable chart with an embedded worksheet after this paragraph.
Parameters
- chartKind OfficeIMO.OfficeChartType
- Default chart family for series without their own render kind.
- data OfficeIMO.Drawing.OfficeChartData
- Shared chart categories, series, and appearance.
- options OfficeIMO.OfficeChartOptions?
- Optional title, physical size and Word frame options. The default size is 600 by 600 pixels.
public WordCheckBox AddCheckBox(bool isChecked = false, string? alias = null, string? tag = null) #Adds a checkbox content control to the paragraph.
Parameters
- isChecked bool = false
- Initial checked state.
- alias string? = null
- Optional alias for the control.
- tag string? = null
- Optional tag for the control.
public WordField AddCitation(string sourceTag) #Adds a citation field referencing the specified source tag.
Parameters
- sourceTag string
- Tag of the bibliographic source.
public WordComboBox AddComboBox(IEnumerable<string> items, string? alias = null, string? tag = null, string? defaultValue = null) #Adds a combo box content control to the paragraph.
Parameters
- items System.Collections.Generic.IEnumerable<string>
- Items to include in the combo box.
- alias string? = null
- Optional alias for the control.
- tag string? = null
- Optional tag for the control.
- defaultValue string? = null
- Optional default value to display; must match one of the provided items.
public WordChart AddComboChart(string title = "", bool roundedCorners = false, OfficeLength? width = null, OfficeLength? height = null) #Creates a chart ready for combining bar and line series. Use WordChart.AddCategories to supply category labels and then call WordChart.AddBar or WordChart.AddLine to add data. AddCategories must be called before adding any series so that both chart types share the same axes.
Parameters
- title string = ""
- roundedCorners bool = false
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
Returns
WordChartpublic WordComment AddComment(string author, string initials, string comment) #Add a comment to paragraph
Parameters
- author string
- The name of the commenting author
- initials string
- The initials of the commenting author
- comment string
- The comment text
Returns
WordCommentpublic WordField AddCrossReference(string referenceId, WordCrossReferenceType type) #Adds a cross reference field to the paragraph.
Parameters
- referenceId string
- Bookmark or heading identifier.
- type OfficeIMO.Word.WordCrossReferenceType
- Type of reference.
public WordDatePicker AddDatePicker(DateTime? date = null, string? alias = null, string? tag = null) #Adds a date picker content control to the paragraph.
Parameters
- date System.DateTime? = null
- Initial date value.
- alias string? = null
- Optional alias for the control.
- tag string? = null
- Optional tag for the control.
public WordParagraph AddDeletedText(string text, string author, DateTime? date = null) #Inserts revision text marked as deleted.
Parameters
- text string
- Text to delete.
- author string
- Revision author.
- date System.DateTime? = null
- Revision date. Uses current date when null.
public WordDropDownList AddDropDownList(IEnumerable<string> items, string? alias = null, string? tag = null) #Adds a dropdown list content control to the paragraph.
Parameters
- items System.Collections.Generic.IEnumerable<string>
- Items to include in the list.
- alias string? = null
- Optional alias for the control.
- tag string? = null
- Optional tag for the control.
public WordEmbeddedObject AddEmbeddedObject(string filePath, string imageFilePath, OfficeLength? width = null, OfficeLength? height = null) #Embeds an object with a preview image.
Parameters
- filePath string
- Path to the object file.
- imageFilePath string
- Preview image path.
- width OfficeIMO.OfficeLength? = null
- Optional physical width; defaults to 64.8 points.
- height OfficeIMO.OfficeLength? = null
- Optional physical height; defaults to 64.8 points.
public WordEmbeddedObject AddEmbeddedObject(string filePath, WordEmbeddedObjectOptions options) #Embeds an object with custom options.
Parameters
- filePath string
- Path to the object file.
- options OfficeIMO.Word.WordEmbeddedObjectOptions
- Embedding options.
public WordEndNote AddEndNote(string text) #Add an end note to the document for this paragraph.
Parameters
- text string
- The text of the end note.
public WordEquation AddEquation(OfficeMathExpression expression) #Adds an inline editable Word equation authored with the reusable OfficeIMO math model.
Parameters
- expression OfficeIMO.Drawing.OfficeMathExpression
Returns
WordEquationpublic WordEquation AddEquation(string omml) #Adds a mathematical equation represented as OMML XML.
Parameters
- omml string
- Office Math Markup Language (OMML) fragment.
public WordField AddField(WordFieldType wordFieldType, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false, List<string>? parameters = null) #Add fields to a word document proceeding from the paragraph this is called on.
Parameters
- wordFieldType OfficeIMO.Word.WordFieldType
- The type of field to add.
- wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null
- The format of the field to add.
- customFormat string? = null
- Custom format string for date or time fields.
- advanced bool = false
- Use advanced field representation.
- parameters System.Collections.Generic.List<string>? = null
- Usages like parameters = new List< String>{ @"\d 'Default'", @"\c" }; Also see available List of switches per field code: https://support.microsoft.com/en-us/office/list-of-field-codes-in-word-1ad6d91a-55a7-4a8d-b535-cf7888659a51
public WordField AddField(WordFieldCode fieldCode, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false) #Add a field represented by a WordFieldCode.
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
- Use advanced field representation.
public WordField AddField(WordFieldBuilder builder, bool advanced = false) #Adds a field constructed using WordFieldBuilder.
Parameters
- builder OfficeIMO.Word.WordFieldBuilder
- Field builder instance.
- advanced bool = false
- Use advanced field representation.
public WordFootNote AddFootNote(string text) #Add a foot note for the current paragraph.
Parameters
- text string
- The text of the note.
Exceptions
InvalidOperationException– The paragraph is in a header or footer.
public WordParagraph AddFormattedText(string text, bool bold = false, bool italic = false, WordUnderlineStyle? underline = null) #Adds formatted text to the paragraph and applies basic run properties.
Parameters
- text string
- Text to insert.
- bold bool = false
- Whether the text should be bold.
- italic bool = false
- Whether the text should be italic.
- underline OfficeIMO.Word.WordUnderlineStyle? = null
- Optional underline style.
public WordParagraph AddHorizontalLine(WordBorderStyle? lineType = null, OfficeColor? color = null, uint size = 12, uint space = 1) #Add horizontal line (sometimes known as horizontal rule) to document proceeding from the paragraph that this is called on.
Parameters
- lineType OfficeIMO.Word.WordBorderStyle? = null
- The type of the line.
- color OfficeIMO.OfficeColor? = null
- The color of the line
- size uint = 12
- The size of the line.
- space uint = 1
- The space the line takes up.
public WordHyperLink AddHyperLink(string text, Uri uri, bool addStyle = false, string tooltip = "", bool history = true) #Add hyperlink with URL to a word document proceding from the paragraph that this was called on.
Parameters
- text string
- The text to insert as the URL.
- uri System.Uri
- The uri that this points to.
- addStyle bool = false
- The optional style of the link.
- tooltip string = ""
- The optional tooltip to display over the link.
- history bool = true
public WordHyperLink AddHyperLink(string text, string anchor, bool addStyle = false, string tooltip = "", bool history = true) #Add hyperlink with an anchor to a word document proceding from the paragraph that this was called on.
Parameters
- text string
- The text to insert as the URL.
- anchor string
- The anchor to point at.
- addStyle bool = false
- The optional style of this link.
- tooltip string = ""
- The optional tooltip over this link.
- history bool = true
public WordImage AddImage(string path, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null) #Embeds an image file and returns its editable occurrence.
Parameters
- path string
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- options OfficeIMO.Word.WordImageOptions? = null
Returns
WordImagepublic WordImage AddImage(Stream stream, string fileName, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null) #Embeds an image stream without disposing the caller's stream.
Parameters
- stream System.IO.Stream
- fileName string
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- options OfficeIMO.Word.WordImageOptions? = null
Returns
WordImagepublic WordImage AddImage(Uri uri, OfficeLength width, OfficeLength height, WordImageOptions? options = null) #Adds a linked external image. The image remains an external relationship.
Parameters
- uri System.Uri
- width OfficeIMO.OfficeLength
- height OfficeIMO.OfficeLength
- options OfficeIMO.Word.WordImageOptions? = null
Returns
WordImagepublic WordParagraph AddInsertedText(string text, string author, DateTime? date = null) #Inserts revision text marked as added.
Parameters
- text string
- Text to insert.
- author string
- Revision author.
- date System.DateTime? = null
- Revision date. Uses current date when null.
public WordLine AddLine(OfficeLength startX, OfficeLength startY, OfficeLength endX, OfficeLength endY, OfficeColor? color = null, OfficeLength? strokeWeight = null) #Adds a VML line and returns the created line.
Parameters
- startX OfficeIMO.OfficeLength
- Start X coordinate.
- startY OfficeIMO.OfficeLength
- Start Y coordinate.
- endX OfficeIMO.OfficeLength
- End X coordinate.
- endY OfficeIMO.OfficeLength
- End Y coordinate.
- color OfficeIMO.OfficeColor? = null
- Stroke color; black when omitted.
- strokeWeight OfficeIMO.OfficeLength? = null
- Stroke thickness; one point when omitted.
Returns
WordLinepublic WordList AddList(WordListStyle style) #Add a list after this paragraph.
Parameters
- style OfficeIMO.Word.WordListStyle
- The style of this list.
public WordParagraph AddPageNumber(bool includeTotalPages = false, WordFieldFormat? format = null, string separator = " of ") #Adds a page number field to the paragraph.
Parameters
- includeTotalPages bool = false
- If true adds a NUMPAGES field preceded by text " of ".
- format OfficeIMO.Word.WordFieldFormat? = null
- Optional field format to apply.
- separator string = " of "
- Text inserted between the current page and total pages fields.
public WordParagraph AddParagraph(WordParagraph? wordParagraph = null) #Add paragraph right after existing paragraph. This can be useful to add empty lines, or moving cursor to next line
Parameters
- wordParagraph OfficeIMO.Word.WordParagraph? = null
- Optional WordParagraph to insert after the given WordParagraph instead of at the end of the document.
public WordParagraph AddParagraph(string text) #Add a paragraph with the given text to the end of the document.
Parameters
- text string
- The text to fill the paragraph with.
public WordParagraph AddParagraphAfterSelf() #Insert a new paragraph after the WordParagraph AddParagraphAfterSelf is called on in the document.
public WordParagraph AddParagraphAfterSelf(WordSection section, WordParagraph? paragraph = null) #Add paragraph after self but by allowing to specify section
Parameters
- section OfficeIMO.Word.WordSection
- The section to add the paragraph to. When paragraph is given this has no effect.
- paragraph OfficeIMO.Word.WordParagraph? = null
- The optional paragraph to add the paragraph to.
public WordParagraph AddParagraphBeforeSelf() #Add a paragraph before the paragraph that AddParagraphBeforeSelf was called on.
public WordPictureControl AddPictureControl(string filePath, OfficeLength? width = null, OfficeLength? height = null, string? alias = null, string? tag = null) #Adds a picture content control containing an image to the paragraph.
Parameters
- filePath string
- Image file path.
- width OfficeIMO.OfficeLength? = null
- Optional physical width of the image.
- height OfficeIMO.OfficeLength? = null
- Optional physical height of the image.
- alias string? = null
- Optional alias for the control.
- tag string? = null
- Optional tag for the control.
public WordRepeatingSection AddRepeatingSection(string? sectionTitle = null, string? alias = null, string? tag = null) #Adds a repeating section content control to the paragraph.
Parameters
- sectionTitle string? = null
- Optional title of the repeating section.
- alias string? = null
- Optional alias for the control.
- tag string? = null
- Optional tag for the control.
public WordShape AddShape(OfficeLength width, OfficeLength height, OfficeColor? fillColor = null) #Adds a VML rectangle to the paragraph and returns the created shape.
Parameters
- width OfficeIMO.OfficeLength
- Rectangle width.
- height OfficeIMO.OfficeLength
- Rectangle height.
- fillColor OfficeIMO.OfficeColor? = null
- Fill color; white when omitted.
Returns
WordShapepublic WordShape AddShape(WordShapeType shapeType, OfficeLength width, OfficeLength height, OfficeColor? fillColor = null, OfficeColor? strokeColor = null, OfficeLength? strokeWeight = null, double arcSize = 0.25) #Adds a VML shape to the paragraph and returns the created shape.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- Type of shape to create.
- width OfficeIMO.OfficeLength
- Width, or the line end X coordinate.
- height OfficeIMO.OfficeLength
- Height, or the line end Y coordinate.
- fillColor OfficeIMO.OfficeColor? = null
- Fill color; white when omitted.
- strokeColor OfficeIMO.OfficeColor? = null
- Outline color; black when omitted.
- strokeWeight OfficeIMO.OfficeLength? = null
- Outline thickness; one point when omitted.
- arcSize double = 0.25
- Dimensionless corner roundness fraction.
Returns
WordShapepublic WordShape AddShapeDrawing(WordShapeType shapeType, OfficeLength width, OfficeLength height) #Adds an inline DrawingML shape and returns the created shape.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- width OfficeIMO.OfficeLength
- height OfficeIMO.OfficeLength
Returns
WordShapepublic WordShape AddShapeDrawing(WordShapeType shapeType, OfficeLength width, OfficeLength height, OfficeLength left, OfficeLength top) #Adds a DrawingML shape anchored at an absolute position on the page.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- width OfficeIMO.OfficeLength
- height OfficeIMO.OfficeLength
- left OfficeIMO.OfficeLength
- top OfficeIMO.OfficeLength
Returns
WordShapepublic WordShapeGroup AddShapeGroup(IEnumerable<WordShapeGroupItem> items) #Adds an inline native DrawingML group of bounded preset shapes.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordShapeGroupItem>
Returns
WordShapeGrouppublic WordShapeGroup AddShapeGroup(IEnumerable<WordShapeGroupItem> items, OfficeLength left, OfficeLength top) #Adds a native DrawingML shape group anchored at page-relative physical offsets.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordShapeGroupItem>
- left OfficeIMO.OfficeLength
- top OfficeIMO.OfficeLength
Returns
WordShapeGrouppublic WordSmartArt AddSmartArt(WordSmartArtType type) #Inserts a SmartArt diagram at the current position.
Parameters
- type OfficeIMO.Word.WordSmartArtType
- Layout of SmartArt to create.
public WordStructuredDocumentTag AddStructuredDocumentTag(string text = "", string? alias = null, string? tag = null) #Adds a simple content control (structured document tag) to the paragraph.
Parameters
- text string = ""
- Initial text of the control.
- alias string? = null
- Optional alias for the content control.
- tag string? = null
- Optional tag for the content control.
public WordParagraph AddTab() #Adds a Tab to a paragraph
public WordTable AddTableAfter(int rows, int columns, WordTableStyle tableStyle = TableGrid) #Add a table after this paragraph and return the table.
Parameters
- rows int
- The number of rows in the table.
- columns int
- The number of columns in the table.
- tableStyle OfficeIMO.Word.WordTableStyle = TableGrid
- The optional style to be applied to the new table, defaults to TableGrid.
public WordTable AddTableBefore(int rows, int columns, WordTableStyle tableStyle = TableGrid) #Add a table before this paragraph and return the table.
Parameters
- rows int
- The number of rows in this table
- columns int
- The number of columns in this table
- tableStyle OfficeIMO.Word.WordTableStyle = TableGrid
- The style of the table being added.
public WordTabStop AddTabStop(OfficeLength position, WordTabAlignment? alignment = null, WordTabLeader? leader = null) #Provides ability for configuration of Tabs in a paragraph by adding one or more TabStops
Parameters
- position OfficeIMO.OfficeLength
- The signed tab position, rounded to the nearest twip.
- alignment OfficeIMO.Word.WordTabAlignment? = null
- The optional alignment for the tabs.
- leader OfficeIMO.Word.WordTabLeader? = null
- The optional rune to use before the tabs.
public WordParagraph AddText(string? text) #Add a text to existing paragraph
Parameters
- text string?
- The text to be added to the paragraph.
public WordTextBox AddTextBox(string text, WordImageTextWrapping wrapTextImage) #Add a text box to the document.
Parameters
- text string
- The text inside the text box.
- wrapTextImage OfficeIMO.Word.WordImageTextWrapping
- The text image wrapping settings.
Returns
WordTextBoxpublic WordTextBox AddTextBoxVml(string text) #Adds a legacy VML text box to the paragraph.
Parameters
- text string
Returns
WordTextBoxpublic WordParagraph ClearTabStops() #Removes this paragraph's explicit tab stops, leaving inherited defaults unchanged.
Returns
WordParagraphpublic bool Equals(WordParagraph? other) #Determines whether the specified WordParagraph is equal to the current instance.
Parameters
- other OfficeIMO.Word.WordParagraph?
- The paragraph to compare with the current instance.
Returns
bool true if the paragraphs are equal; otherwise, false.public override bool Equals(object? obj) #Determines whether the specified object is equal to the current instance.
Parameters
- obj object?
- The object to compare with the current instance.
Returns
bool true if the objects are equal; otherwise, false.public OfficeLength GetContentWidth() #Estimates the authored content width available to an inline drawing in this paragraph as a physical length.
Returns
OfficeLength A positive width after the containing cell or section geometry and direct paragraph indents.Exceptions
InvalidOperationException– The paragraph is detached, belongs to an unsupported text box, has ambiguous story geometry, or its margins and indents leave no positive content width.
public IEnumerable<WordFormattedRun> GetFormattedRuns() #Enumerates this paragraph's text and image runs with reader-facing formatting metadata.
public override int GetHashCode() #Serves as the default hash function.
Returns
int A hash code for the current object.public WordListStyle? GetListStyle() #Gets the list style when this paragraph is part of a list.
Returns
WordListStyle?public WordRange GetRange() #Returns a range covering all visible text of the paragraph that contains this element.
public WordRange GetRange(int start, int length) #Returns a range of the visible text of the paragraph that contains this element.
Parameters
- start int
- Zero-based offset from the start of the paragraph text, counting all of its runs.
- length int
- Number of characters; zero gives an empty range that marks a position.
public IEnumerable<WordParagraph> GetRuns() #Enumerates visible runs in paragraph order, including cached simple-field results and hyperlink runs.
Returns
IEnumerable<WordParagraph>public static bool op_Equality(WordParagraph? left, WordParagraph? right) #Determines whether two WordParagraph instances are equal.
Parameters
- left OfficeIMO.Word.WordParagraph?
- The left-hand instance.
- right OfficeIMO.Word.WordParagraph?
- The right-hand instance.
Returns
bool true if the instances are equal; otherwise, false.public static bool op_Inequality(WordParagraph? left, WordParagraph? right) #Determines whether two WordParagraph instances are not equal.
Parameters
- left OfficeIMO.Word.WordParagraph?
- The left-hand instance.
- right OfficeIMO.Word.WordParagraph?
- The right-hand instance.
Returns
bool true if the instances are not equal; otherwise, false.public void RemoveCheckBox() #Removes the checkbox from the paragraph.
public void RemoveHyperLink(bool includingParagraph = false) #Removes hyperlink from this paragraph and detaches its relationship.
Parameters
- includingParagraph bool = false
- If true removes the paragraph when it becomes empty.
public WordParagraph SetAlignment(WordParagraphAlignment alignment) #Sets the paragraph alignment.
Parameters
- alignment OfficeIMO.Word.WordParagraphAlignment
- Alignment value.
public WordParagraph SetBackgroundColor(OfficeColor color) #Applies an exact background (run shading fill) color to the current text run.
Parameters
- color OfficeIMO.OfficeColor
- The background color.
public WordParagraph SetBold(bool isBold = true) #Sets the WordParagraph.Bold property.
Parameters
- isBold bool = true
- Whether the text should be bold.
public WordParagraph SetCapsStyle(WordCapsStyle capsStyle) #Sets the capitalization style for the text.
Parameters
- capsStyle OfficeIMO.Word.WordCapsStyle
- Capitalization style.
public WordParagraph SetCharacterStyle(WordStyle style) #Applies a character style defined in this paragraph's document to the run.
Parameters
- style OfficeIMO.Word.WordStyle
- A character style from WordDocument.Styles.
Exceptions
ArgumentException– The style is not a character style of this document.
public WordParagraph SetCharacterStyle(WordCharacterStyles style) #Sets the character style for the run.
Parameters
- style OfficeIMO.Word.WordCharacterStyles
- Character style to apply.
public WordParagraph SetCharacterStyleId(string styleId) #Sets the character style by identifier.
Parameters
- styleId string
- The style identifier.
public void SetCheckBoxValue(bool value) #Sets the checked state of the paragraph's checkbox.
Parameters
- value bool
- New checked state.
public WordParagraph SetColor(OfficeColor color) #Sets the text color using OfficeColor.
Parameters
- color OfficeIMO.OfficeColor
- The color to apply.
public WordParagraph SetDoubleStrikethrough(bool doubleStrikethrough = true) #Enables or disables double strikethrough on the text.
Parameters
- doubleStrikethrough bool = true
- Whether the text should be double struck.
public WordParagraph SetEmboss(bool isEmboss = true) #Enables or disables emboss effect on the text.
Parameters
- isEmboss bool = true
- Whether the text should be embossed.
public WordParagraph SetFontFamily(string fontFamily) #Sets the font family for the text.
Parameters
- fontFamily string
- Name of the font family.
public WordParagraph SetFontSize(OfficeLength fontSize) #Sets the font size for the text.
Parameters
- fontSize OfficeIMO.OfficeLength
- Font size in points.
public WordParagraph SetHighlight(WordHighlightColor highlight) #Sets the highlight color for the text.
Parameters
- highlight OfficeIMO.Word.WordHighlightColor
- Highlight color.
public WordParagraph SetItalic(bool isItalic = true) #Sets the WordParagraph.Italic property.
Parameters
- isItalic bool = true
- Whether the text should be italic.
public WordParagraph SetLanguage(string language) #Sets the language for the text run.
Parameters
- language string
- Language tag, such as en-US or pl-PL.
public WordParagraph SetOutline(bool isOutline = true) #Enables or disables outline effect on the text.
Parameters
- isOutline bool = true
- Whether the text should be outlined.
public WordParagraph SetShadow(bool isShadow = true) #Enables or disables shadow effect on the text.
Parameters
- isShadow bool = true
- Whether the text should have a shadow.
public WordParagraph SetSmallCaps(bool isSmallCaps = true) #Enables or disables small caps formatting on the text.
Parameters
- isSmallCaps bool = true
- Whether the text should use small caps.
public WordParagraph SetSpacing(OfficeLength? spacing) #Sets the character spacing for the text.
Parameters
- spacing OfficeIMO.OfficeLength?
- Signed character spacing, or null to remove the local value.
public WordParagraph SetStrikethrough(bool strikethrough = true) #Enables or disables single strikethrough on the text.
Parameters
- strikethrough bool = true
- Whether the text should be struck through.
public WordParagraph SetStyle(WordParagraphStyles style) #Sets the paragraph style.
Parameters
- style OfficeIMO.Word.WordParagraphStyles
- The style to apply.
public WordParagraph SetStyle(WordStyle style) #Applies a paragraph style defined in this paragraph's document.
Parameters
- style OfficeIMO.Word.WordStyle
- A paragraph style from WordDocument.Styles.
Exceptions
ArgumentException– The style is not a paragraph style of this document.
public WordParagraph SetStyleId(string styleId) #Sets the paragraph style by identifier.
Parameters
- styleId string
- The style identifier.
public WordParagraph SetText(string text) #Sets the paragraph text.
Parameters
- text string
- The text content.
public WordParagraph SetUnderline(WordUnderlineStyle underline) #Sets the underline style for the text.
Parameters
- underline OfficeIMO.Word.WordUnderlineStyle
- Underline style.
public WordParagraph SetVerticalTextAlignment(WordVerticalTextPosition? verticalPositionValue) #Set the vertical text alignment
Parameters
- verticalPositionValue OfficeIMO.Word.WordVerticalTextPosition?
Returns
WordParagraphpublic WordParagraph TransformTextCase(OfficeTextCase textCase, CultureInfo? culture = null) #Changes the stored run text casing while preserving run formatting.
Parameters
- textCase OfficeIMO.Drawing.OfficeTextCase
- Casing transformation to apply.
- culture System.Globalization.CultureInfo? = null
- Culture used for casing. The current culture is used when omitted.
Inherited Methods
Properties
public WordTabChar? Tab { get; } #Gets the WordTabChar representing a tab character in the current run, or null if none is present.
public bool IsTab { get; } #Gets a value indicating whether the run within the paragraph contains a tab character.
public List<WordTabStop> TabStops { get; } #Gets all tab stops defined on the paragraph.
public int? CharacterScale { get; set; } #Gets or sets the directly authored character width as a percentage between 1 and 600. A value of 100 restores normal width; null removes the direct value and restores style inheritance. Character height and character spacing are independent of this setting.
public WordStructuredDocumentTag? StructuredDocumentTag { get; } #Gets the structured document tag contained in this paragraph, if present.
public WordCheckBox? CheckBox { get; } #Gets the checkbox contained in this paragraph, if present.
public WordDatePicker? DatePicker { get; } #Gets the date picker contained in this paragraph, if present.
public WordDropDownList? DropDownList { get; } #Gets the dropdown list contained in this paragraph, if present.
public WordComboBox? ComboBox { get; } #Gets the combo box contained in this paragraph, if present.
public WordPictureControl? PictureControl { get; } #Gets the picture content control contained in this paragraph, if present.
public WordRepeatingSection? RepeatingSection { get; } #Gets the repeating section contained in this paragraph, if present.
public bool IsStructuredDocumentTag { get; } #Gets a value indicating whether the paragraph holds a structured document tag.
public bool IsCheckBox { get; } #Gets a value indicating whether the paragraph contains a checkbox control.
public bool IsDatePicker { get; } #Gets a value indicating whether the paragraph contains a date picker control.
public bool IsDropDownList { get; } #Gets a value indicating whether the paragraph contains a dropdown list control.
public bool IsComboBox { get; } #Gets a value indicating whether the paragraph contains a combo box control.
public bool IsPictureControl { get; } #Gets a value indicating whether the paragraph contains a picture control.
public bool IsRepeatingSection { get; } #Gets a value indicating whether the paragraph contains a repeating section control.
public object? Parent { get; internal set; } #Gets the parent object that owns this paragraph (for example a table cell, header, footer or section).
public bool IsLastRun { get; } #Gets a value indicating whether this run is the last run within its parent container.
public bool IsFirstRun { get; } #Gets a value indicating whether this run is the first run within its parent container.
public bool IsListItem { get; } #Gets a value indicating whether this paragraph is part of a numbered or bulleted list.
public int? ListItemLevel { get; set; } #Gets or sets the indentation level for the paragraph when it belongs to a list.
public WordListStyle? ListStyle { get; } #Gets the list style when this paragraph is part of a list.
public WordParagraphStyles? Style { get; set; } #Gets or sets the paragraph style. Updating this to a heading style will flag the document to update the table of contents on open.
public WordImage? Image { get; } #Gets the first independent image associated with this run, if any. Group-owned images remain part of their group.
public WordEmbeddedObject? EmbeddedObject { get; } #Gets the embedded object associated with this run, if any.
public WordChart? Chart { get; } #Gets the chart contained in this paragraph, if present.
public WordSmartArt? SmartArt { get; } #Gets the SmartArt diagram contained in this paragraph, if present.
public bool IsImage { get; } #Gets a value indicating whether an image is found in the paragraph.
public bool IsEmbeddedObject { get; } #Gets a value indicating whether the paragraph has an embedded object.
public bool IsChart { get; } #Gets a value indicating whether a chart is associated with the paragraph.
public bool IsSmartArt { get; } #Gets a value indicating whether SmartArt is present in the paragraph.
public WordTextBox? TextBox { get; } #Gets the WordTextBox contained within the paragraph, if any.
public WordLine? Line { get; } #Gets the line shape contained in this paragraph, if present.
public bool IsTextBox { get; } #Gets a value indicating whether the paragraph contains a text box.
public bool IsShape { get; } #Gets a value indicating whether the paragraph contains a shape.
public bool IsLine { get; } #Gets a value indicating whether the paragraph contains a VML line shape.
public bool? PageBreakBeforeOverride { get; set; } #Gets or sets directly authored page-break-before formatting. Null restores style inheritance; false overrides an enabled style.
public bool? KeepWithNextOverride { get; set; } #Gets or sets directly authored keep-with-next formatting. Null restores style inheritance; false overrides an enabled style.
public bool? KeepLinesTogetherOverride { get; set; } #Gets or sets directly authored keep-lines-together formatting. Null restores style inheritance; false overrides an enabled style.
public bool? AvoidWidowAndOrphanOverride { get; set; } #Gets or sets directly authored widow/orphan control. Null restores style inheritance; false disables the control.
public bool? ContextualSpacing { get; set; } #Gets or sets suppression of spacing between paragraphs of the same style. Null restores style inheritance.
public bool? SuppressLineNumbers { get; set; } #Gets or sets paragraph line-number suppression. Null restores style inheritance. This preserves the Word setting and does not enable line-number rendering in PDF.
public bool? SuppressAutoHyphens { get; set; } #Gets or sets paragraph automatic-hyphenation suppression. Null restores style inheritance. Automatic Word hyphenation is not supplied by this property.
public bool? MirrorIndents { get; set; } #Gets or sets use of left/right indents as inside/outside indents. Null restores style inheritance. Fixed-layout exporters have their own mirrored-layout support limits.
public int? OutlineLevel { get; set; } #Gets or sets the directly authored outline level: 0-8 for heading levels 1-9, 9 for body text, or null to inherit. Word uses the built-in heading level for Heading1-Heading9 styles regardless of this authored value.
public OfficeLength? KerningMinimumFontSize { get; set; } #Gets or sets the minimum font size, in points, at which this run uses kerning. Null inherits the threshold; zero disables kerning. Values from zero to 1638 are rounded to Word's half-point precision and are preserved in DOCX and native DOC.
public WordParagraphBorders Borders { get; } #Provides access to the borders applied to this paragraph.
public string? StyleId { get; } #Gets the identifier of the paragraph style, if any.
public WordParagraphAlignment? ParagraphAlignment { get; set; } #Alignment aka Paragraph Alignment. This element specifies the paragraph alignment which shall be applied to text in this paragraph. If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e.that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no alignment is applied to the paragraph. Setting this property to null removes direct alignment and restores style inheritance.
public WordVerticalCharacterAlignment? VerticalCharacterAlignmentOnLine { get; set; } #Text Alignment aka Vertical Character Alignment on Line. This element specifies the vertical alignment of all text on each line displayed within a paragraph. If the line height (before any added spacing) is larger than one or more characters on the line, all characters are aligned to each other as specified by this element. If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e.that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then the vertical alignment of all characters on the line shall be automatically determined by the consumer. Setting this property to null removes direct alignment and restores style inheritance.
public OfficeLength? IndentationBefore { get; set; } #Gets or sets the indentation before the paragraph as a physical length.
public OfficeLength? IndentationAfter { get; set; } #Gets or sets the indentation after the paragraph as a physical length.
public bool PageBreakBefore { get; set; } #Gets or sets a directly authored page-break-before value; this does not resolve inherited paragraph styles.
public bool KeepWithNext { get; set; } #Gets or sets directly authored keep-with-next formatting without resolving paragraph styles.
public bool KeepLinesTogether { get; set; } #Gets or sets directly authored keep-lines-together formatting without resolving paragraph styles.
public bool AvoidWidowAndOrphan { get; set; } #Gets or sets directly authored widow and orphan control without resolving paragraph styles.
public OfficeLength? IndentationFirstLine { get; set; } #Gets or sets the first line indentation as a physical length.
public OfficeLength? IndentationHanging { get; set; } #Gets or sets the hanging indentation as a physical length.
public WordTextDirection? TextDirection { get; set; } #Gets or sets the text flow direction for the paragraph.
public bool BiDi { get; set; } #Gets or sets directly authored right-to-left layout without resolving paragraph styles.
public WordLineSpacing? LineSpacing { get; set; } #Gets or sets directly authored line spacing as a multiplier, exact height, or minimum height. Null removes both line attributes, retaining before/after and other spacing attributes.
public OfficeLength? LineSpacingBefore { get; set; } #Gets or sets the spacing before the paragraph as a physical length.
public OfficeLength? LineSpacingAfter { get; set; } #Gets or sets the spacing after the paragraph as a physical length.
public WordVerticalTextPosition? VerticalTextAlignment { get; set; } #Gets or sets the vertical text alignment - the alignment of the text in the paragraph with respect to the line height.
public WordBookmark? Bookmark { get; } #Gets the bookmark associated with this paragraph, if present.
public WordEquation? Equation { get; } #Gets the mathematical equation contained in this paragraph, if any.
public WordField? Field { get; } #Gets the field contained in this paragraph, if any.
public WordHyperLink? Hyperlink { get; } #Gets the hyperlink contained in this paragraph, if present.
public WordFootNote? FootNote { get; } #Gets the footnote associated with this paragraph, if any.
public WordEndNote? EndNote { get; } #Gets the endnote associated with this paragraph, if any.
public bool IsHyperLink { get; } #Gets a value indicating whether the paragraph contains a hyperlink.
public bool IsField { get; } #Gets a value indicating whether the paragraph hosts a field code.
public bool IsBookmark { get; } #Gets a value indicating whether the paragraph includes a bookmark start tag.
public bool IsEquation { get; } #Gets a value indicating whether the paragraph contains an equation.
public bool IsEndNote { get; } #Gets a value indicating whether an endnote reference is present in the paragraph.
public bool IsFootNote { get; } #Gets a value indicating whether a footnote reference is present in the paragraph.
public bool IsEmpty { get; } #Gets a value indicating whether the paragraph contains no run element.
public bool IsPageBreak { get; } #Gets a value indicating whether the paragraph contains a page break.
public bool IsColumnBreak { get; } #Gets a value indicating whether the paragraph contains a column break.
public bool IsBreak { get; } #Gets a value indicating whether the paragraph contains a break element.
public bool Bold { get; set; } #Gets or sets a value indicating whether the run is bold. Setting false explicitly overrides inherited bold.
public bool Italic { get; set; } #Gets or sets a value indicating whether the run is italic. Setting false explicitly overrides inherited italic.
public WordUnderlineStyle? Underline { get; set; } #Gets or sets the underline style for the run.
public bool DoNotCheckSpellingOrGrammar { get; set; } #Gets or sets a value indicating whether spelling and grammar checks are disabled.
public OfficeLength? Spacing { get; set; } #Gets or sets the signed physical character spacing. Null removes the local value.
public bool Strikethrough { get; set; } #Gets or sets a value indicating whether the run is struck through.
public bool DoubleStrikethrough { get; set; } #Gets or sets a value indicating whether the run has a double strikethrough.
public bool Outline { get; set; } #Gets or sets a value indicating whether the run text is outlined.
public bool Shadow { get; set; } #Gets or sets a value indicating whether the run has a shadow effect.
public bool Emboss { get; set; } #Gets or sets a value indicating whether the run is embossed.
public OfficeLength? FontSize { get; set; } #Gets or sets the font size in points with Word's native half-point precision. Values finer than half a point are rounded away from zero to the nearest representable size.
public OfficeColor? Color { get; set; } #Gets or sets the text color using OfficeColor.
public WordThemeColor? ThemeColor { get; set; } #Gets or sets the theme color applied to the run.
public WordHighlightColor? Highlight { get; set; } #Gets or sets the highlight color applied to the run.
public WordCapsStyle CapsStyle { get; set; } #Gets or sets the capitalization style for the run.
public string? FontFamily { get; set; } #FontFamily gets and sets the FontFamily of a WordParagraph. To make sure that FontFamily works correctly on special characters we change the RunFonts.Ascii and RunFonts.HighAnsi, EastAsia and ComplexScript properties If you want to set different FontFamily for HighAnsi, EastAsia and ComplexScript please use FontFamilyHighAnsi, FontFamilyEastAsia or FontFamilyComplexScript in proper order (to overwrite given FontFamily)
public string? FontFamilyHighAnsi { get; set; } #Gets or sets the HighAnsi font family.
public string? FontFamilyEastAsia { get; set; } #Gets or sets the East Asia font family.
public string? FontFamilyComplexScript { get; set; } #Gets or sets the complex script font family.
public string? Language { get; set; } #Gets or sets the language applied to the run.
public WordCharacterStyles? CharacterStyle { get; set; } #Gets or sets the character style applied to the run.
public string? CharacterStyleId { get; set; } #Gets or sets the style identifier applied to the run.
public OfficeColor? BackgroundColor { get; set; } #Gets or sets the background (run shading fill) color applied to the current text run.
public OfficeColor? ShadingFillColor { get; set; } #Get or set the paragraph shading fill color. Setting null removes the shading.
public WordShadingPattern? ShadingPattern { get; set; } #Get or set the paragraph shading pattern.
public WordShapeGroup? ShapeGroup { get; } #Gets the native DrawingML shape group hosted by this paragraph, when present.
public bool IsShapeGroup { get; } #Gets whether this paragraph hosts a native DrawingML shape group.
public string Text { get; set; } #Gets or sets the text for this run. Text-wrapping breaks (null or BreakValues.TextWrapping) are surfaced as "\n" in the returned string so callers receive the same representation on every platform. The setter accepts any mix of "\r\n", "\r", or "\n" and normalizes them to "\n" before updating the OpenXML elements. Non text-wrapping breaks—such as page or column breaks—are represented using the Unicode line separator character ('\u2028') so that text operations (for example find/replace) can preserve their positions. When the text is modified those breaks are re-inserted at their original locations. Imported text nodes honor xml:space: insignificant XML whitespace at either edge is omitted unless the node declares preserve. Reading text preserves source XML.
Extension Methods
public static string ToXml(WordParagraph paragraph) #Returns the raw Open XML string representing the paragraph.
Parameters
- paragraph OfficeIMO.Word.WordParagraph
- Paragraph to convert.
Returns
string Outer XML of the underlying Open XML element.