API Reference
WordParagraph
Represents a paragraph within a Word document.
Inheritance
- WordElement
- WordParagraph
Usage
Explore 252 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 209
- Property RunBuilder.Run
- Property TextBuilder.Paragraph
- Method WordFluentDocument.Paragraphs
- Property WordParagraphBuilder.Paragraph
- Method WordBookmark.AddBookmark
- Method WordCrossReference.AddCrossReference
- Extension method WordDocument.AddParagraphFromXml
- Method WordDocument.AddBookmark
- Method WordDocument.AddBreak
- Method WordDocument.AddCitation
- Method WordDocument.AddEmbeddedObject
- Method WordDocument.AddEquation
- Method WordDocument.AddField
- Method WordDocument.AddHorizontalLine
- Method WordDocument.AddHyperLink
- Method WordDocument.AddPageBreak
- Method WordDocument.AddParagraph
- Method WordDocument.Find
- 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
- Method WordDocumentTraversal.BuildListIndices
- Method WordDocumentTraversal.BuildListMarkers
- Property WordEndNote.Paragraphs
- Property WordEndNote.ParentParagraph
- Method WordField.AddField
- Method WordFooter.AddBookmark
- Method WordFooter.AddField
- Method WordFooter.AddHorizontalLine
- Method WordFooter.AddHyperLink
- 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.Paragraphs
- Property WordFootNote.ParentParagraph
- Method WordHeader.AddBookmark
- Method WordHeader.AddField
- Method WordHeader.AddHorizontalLine
- Method WordHeader.AddHyperLink
- 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.AddBookmark
- Method WordHeaderFooter.AddField
- Method WordHeaderFooter.AddHorizontalLine
- Method WordHeaderFooter.AddHyperLink
- 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
- Method WordHyperLink.AddHyperLink
- Method WordList.AddItem
- Property WordList.ListItems
- Method WordPageNumber.AppendText
- Property WordPageNumber.Paragraph
- Property WordPageNumber.Paragraphs
- Method WordParagraph.AddBookmark
- Method WordParagraph.AddBreak
- Method WordParagraph.AddCitation
- Method WordParagraph.AddCrossReference
- Method WordParagraph.AddDeletedText
- Method WordParagraph.AddEmbeddedObject
- Method WordParagraph.AddEndNote
- Method WordParagraph.AddEquation
- Method WordParagraph.AddField
- Method WordParagraph.AddFootNote
- Method WordParagraph.AddFormattedText
- Method WordParagraph.AddHorizontalLine
- Method WordParagraph.AddHyperLink
- Method WordParagraph.AddImage
- Method WordParagraph.AddImageFromBase64
- Method WordParagraph.AddImageFromResource
- Method WordParagraph.AddImageVml
- 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.SetBold
- Method WordParagraph.SetCapsStyle
- Method WordParagraph.SetCharacterStyle
- Method WordParagraph.SetCharacterStyleId
- Method WordParagraph.SetColor
- Method WordParagraph.SetColorHex
- Method WordParagraph.SetDoubleStrike
- Method WordParagraph.SetEmboss
- Method WordParagraph.SetFontFamily
- Method WordParagraph.SetFontSize
- Method WordParagraph.SetHighlight
- Method WordParagraph.SetItalic
- Method WordParagraph.SetLanguage
- Method WordParagraph.SetOutline
- Method WordParagraph.SetRunShadingFillColorHex
- Method WordParagraph.SetShadow
- Method WordParagraph.SetSmallCaps
- Method WordParagraph.SetSpacing
- Method WordParagraph.SetStrike
- 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.EvenPageFooterParagraphs
- Property WordSearchResult.EvenPageHeaderParagraphs
- Property WordSearchResult.FirstPageFooterParagraphs
- Property WordSearchResult.FirstPageHeaderParagraphs
- Property WordSearchResult.TableParagraphs
- Method WordSection.AddFooterParagraph
- Method WordSection.AddHeaderParagraph
- Method WordSection.AddHorizontalLine
- Method WordSection.AddHyperLink
- 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 WordTextBox.Paragraphs
- Method WordXmlExtensions.AddParagraphFromXml
Accepted by parameters 43
- Method WordBookmark.AddBookmark
- Constructor WordChart.WordChart
- Method WordCrossReference.AddCrossReference
- Method WordDocument.AcceptRevisionsInParagraph
- Method WordDocument.AddEmbeddedFragmentAfter
- Method WordDocument.AddParagraph
- Method WordDocument.FindAndReplace
- Method WordDocument.InsertParagraphAt
- Method WordDocument.InsertTableAfter
- Method WordDocument.RejectRevisionsInParagraph
- Method WordDocumentTraversal.GetListInfo
- Constructor WordEmbeddedObject.WordEmbeddedObject
- Method WordField.AddField
- Method WordHyperLink.AddHyperLink
- Method WordHyperLink.AddHyperLink
- Constructor WordImage.WordImage
- 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 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, Boolean newParagraph = true, Boolean newRun = true) #Initializes a new paragraph.
Parameters
- document OfficeIMO.Word.WordDocument? = null
- Parent document.
- newParagraph System.Boolean = true
- Create a new paragraph element.
- newRun System.Boolean = true
- Create a new run inside the paragraph.
Methods
public WordParagraph AddBookmark(String bookmarkName) #WordParagraphAdd bookmark to a word document proceeding from the paragraph this was called on.
Parameters
- bookmarkName System.String
- The name of the bookmark.
Returns
The paragraph that this was called on.
public WordParagraph AddBreak(WordBreakType? breakType = null) #WordParagraphAdd 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.
Returns
The new WordParagraph that this method creates.
public WordChart AddChart(String title = "", Boolean roundedCorners = false, Int32 width = 600, Int32 height = 600) #WordChartAdds 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 System.String = ""
- The title.
- roundedCorners System.Boolean = false
- if set to true [rounded corners].
- width System.Int32 = 600
- The width.
- height System.Int32 = 600
- The height.
Returns
WordChart
public WordChart AddChart(OfficeChartKind chartKind, OfficeChartData data, String title = "", Boolean roundedCorners = false, Int32 width = 600, Int32 height = 600) #WordChartInserts an editable chart with an embedded worksheet after this paragraph.
Parameters
- chartKind OfficeIMO.Drawing.OfficeChartKind
- Default chart family for series without their own render kind.
- data OfficeIMO.Drawing.OfficeChartData
- Shared chart categories, series, and appearance.
- title System.String = ""
- Optional chart title.
- roundedCorners System.Boolean = false
- Whether the chart frame has rounded corners.
- width System.Int32 = 600
- Drawing width in pixels.
- height System.Int32 = 600
- Drawing height in pixels.
Returns
The created chart.
public WordCheckBox AddCheckBox(Boolean isChecked = false, String? alias = null, String? tag = null) #WordCheckBoxAdds a checkbox content control to the paragraph.
Parameters
- isChecked System.Boolean = false
- Initial checked state.
- alias System.String? = null
- Optional alias for the control.
- tag System.String? = null
- Optional tag for the control.
Returns
The created WordCheckBox instance.
public WordParagraph AddCitation(String sourceTag) #WordParagraphAdds a citation field referencing the specified source tag.
Parameters
- sourceTag System.String
- Tag of the bibliographic source.
Returns
The paragraph that this was called on.
public WordComboBox AddComboBox(IEnumerable<String> items, String? alias = null, String? tag = null, String? defaultValue = null) #WordComboBoxAdds a combo box content control to the paragraph.
Parameters
- items System.Collections.Generic.IEnumerable<System.String>
- Items to include in the combo box.
- alias System.String? = null
- Optional alias for the control.
- tag System.String? = null
- Optional tag for the control.
- defaultValue System.String? = null
- Optional default value to display; must match one of the provided items.
Returns
The created WordComboBox instance.
public WordChart AddComboChart(String title = "", Boolean roundedCorners = false, Int32 width = 600, Int32 height = 600) #WordChartCreates a chart ready for combining bar and line series. Use WordChart.AddChartAxisX to supply category labels and then call WordChart.AddBar or WordChart.AddLine to add data. AddChartAxisX must be called before adding any series so that both chart types share the same axes.
Parameters
- title System.String = ""
- roundedCorners System.Boolean = false
- width System.Int32 = 600
- height System.Int32 = 600
public Void AddComment(String author, String initials, String comment) #VoidAdd a comment to paragraph
Parameters
- author System.String
- The name of the commenting author
- initials System.String
- The initials of the commenting author
- comment System.String
- The comment text
public WordParagraph AddCrossReference(String referenceId, WordCrossReferenceType type) #WordParagraphAdds a cross reference field to the paragraph.
Parameters
- referenceId System.String
- Bookmark or heading identifier.
- type OfficeIMO.Word.WordCrossReferenceType
- Type of reference.
Returns
The paragraph that this was called on.
public WordDatePicker AddDatePicker(DateTime? date = null, String? alias = null, String? tag = null) #WordDatePickerAdds a date picker content control to the paragraph.
Parameters
- date System.DateTime? = null
- Initial date value.
- alias System.String? = null
- Optional alias for the control.
- tag System.String? = null
- Optional tag for the control.
Returns
The created WordDatePicker instance.
public WordParagraph AddDeletedText(String text, String author, DateTime? date = null) #WordParagraphInserts revision text marked as deleted.
Parameters
- text System.String
- Text to delete.
- author System.String
- Revision author.
- date System.DateTime? = null
- Revision date. Uses current date when null.
Returns
The current WordParagraph instance.
public WordDropDownList AddDropDownList(IEnumerable<String> items, String? alias = null, String? tag = null) #WordDropDownListAdds a dropdown list content control to the paragraph.
Parameters
- items System.Collections.Generic.IEnumerable<System.String>
- Items to include in the list.
- alias System.String? = null
- Optional alias for the control.
- tag System.String? = null
- Optional tag for the control.
Returns
The created WordDropDownList instance.
public WordParagraph AddEmbeddedObject(String filePath, String imageFilePath, Double? width = null, Double? height = null) #WordParagraphEmbeds an object with a preview image.
Parameters
- filePath System.String
- Path to the object file.
- imageFilePath System.String
- Preview image path.
- width System.Double? = null
- Optional width in points.
- height System.Double? = null
- Optional height in points.
Returns
The paragraph containing the embedded object.
public WordParagraph AddEmbeddedObject(String filePath, WordEmbeddedObjectOptions options) #WordParagraphEmbeds an object with custom options.
Parameters
- filePath System.String
- Path to the object file.
- options OfficeIMO.Word.WordEmbeddedObjectOptions
- Embedding options.
Returns
The paragraph containing the embedded object.
public WordParagraph AddEndNote(String text) #WordParagraphAdd an end note to the document for this paragraph.
Parameters
- text System.String
- The text of the end note.
Returns
The end note.
public WordParagraph AddEquation(OfficeMathExpression expression) #WordParagraphAdds an inline editable Word equation authored with the reusable OfficeIMO math model.
Parameters
- expression OfficeIMO.Drawing.OfficeMathExpression
public WordParagraph AddEquation(String omml) #WordParagraphAdds a mathematical equation represented as OMML XML.
Parameters
- omml System.String
- Office Math Markup Language (OMML) fragment.
Returns
The paragraph that this was called on.
public WordParagraph AddField(WordFieldType wordFieldType, WordFieldFormat? wordFieldFormat = null, String? customFormat = null, Boolean advanced = false, List<String>? parameters = null) #WordParagraphAdd 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 System.String? = null
- Custom format string for date or time fields.
- advanced System.Boolean = false
- Use advanced field representation.
- parameters System.Collections.Generic.List<System.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
Returns
The paragraph that this was called on.
public WordParagraph AddField(WordFieldCode fieldCode, WordFieldFormat? wordFieldFormat = null, String? customFormat = null, Boolean advanced = false) #WordParagraphAdd 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 System.String? = null
- Custom format string for date or time fields.
- advanced System.Boolean = false
- Use advanced field representation.
Returns
The paragraph that this was called on.
public WordParagraph AddField(WordFieldBuilder builder, Boolean advanced = false) #WordParagraphAdds a field constructed using WordFieldBuilder.
Parameters
- builder OfficeIMO.Word.WordFieldBuilder
- Field builder instance.
- advanced System.Boolean = false
- Use advanced field representation.
Returns
The paragraph that this was called on.
public WordParagraph AddFootNote(String text) #WordParagraphAdd a foot note for the current paragraph.
Parameters
- text System.String
- The text of the note.
Returns
The footnote.
public WordParagraph AddFormattedText(String text, Boolean bold = false, Boolean italic = false, WordUnderlineStyle? underline = null) #WordParagraphAdds formatted text to the paragraph and applies basic run properties.
Parameters
- text System.String
- Text to insert.
- bold System.Boolean = false
- Whether the text should be bold.
- italic System.Boolean = false
- Whether the text should be italic.
- underline OfficeIMO.Word.WordUnderlineStyle? = null
- Optional underline style.
Returns
The run containing the formatted text.
public WordParagraph AddHorizontalLine(WordBorderStyle? lineType = null, OfficeColor? color = null, UInt32 size = 12, UInt32 space = 1) #WordParagraphAdd 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.Drawing.OfficeColor? = null
- The color of the line
- size System.UInt32 = 12
- The size of the line.
- space System.UInt32 = 1
- The space the line takes up.
Returns
The new Paragraph after the line.
public WordParagraph AddHyperLink(String text, Uri uri, Boolean addStyle = false, String tooltip = "", Boolean history = true) #WordParagraphAdd hyperlink with URL to a word document proceding from the paragraph that this was called on.
Parameters
- text System.String
- The text to insert as the URL.
- uri System.Uri
- The uri that this points to.
- addStyle System.Boolean = false
- The optional style of the link.
- tooltip System.String = ""
- The optional tooltip to display over the link.
- history System.Boolean = true
Returns
The paragraph that this was called on.
public WordParagraph AddHyperLink(String text, String anchor, Boolean addStyle = false, String tooltip = "", Boolean history = true) #WordParagraphAdd hyperlink with an anchor to a word document proceding from the paragraph that this was called on.
Parameters
- text System.String
- The text to insert as the URL.
- anchor System.String
- The anchor to point at.
- addStyle System.Boolean = false
- The optional style of this link.
- tooltip System.String = ""
- The optional tooltip over this link.
- history System.Boolean = true
Returns
The paragraph that this was called on.
public WordParagraph AddImage(String filePathImage, Double? width = null, Double? height = null, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordParagraphAdd image from file with ability to provide width and height of the image The image will be resized given new dimensions
Parameters
- filePathImage System.String
- Path to file to import to Word Document
- width System.Double? = null
- Optional width of the image. If not given the actual image width will be used.
- height System.Double? = null
- Optional height of the image. If not given the actual image height will be used.
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- Optional text wrapping rule. If not given the image will be inserted inline to the text.
- description System.String = ""
- The description for this image.
Returns
The WordParagraph that AddImage was called on.
public WordParagraph AddImage(Stream imageStream, String fileName, Double? width, Double? height, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordParagraphAdd image from Stream with ability to provide width and height of the image The image will be resized given new dimensions
Parameters
- imageStream System.IO.Stream
- The stream to load the image from.
- fileName System.String
- The name of the file.
- width System.Double?
- Optional width of the image. If not given the actual image width will be used.
- height System.Double?
- Optional height of the image. If not give the actual image height will be used.
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- Optional text wrapping rule. If not given the image will be inserted inline to the text.
- description System.String = ""
- The description for this image.
Returns
The WordParagraph that AddImage was called on.
public WordParagraph AddImage(Uri imageUri, Double width, Double height, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordParagraphAdd an image that is stored outside the package.
Parameters
- imageUri System.Uri
- width System.Double
- height System.Double
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- description System.String = ""
public WordParagraph AddImageFromBase64(String base64String, String fileName, Double? width = null, Double? height = null, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordParagraphAdd image from a Base64 encoded string.
Parameters
- base64String System.String
- fileName System.String
- width System.Double? = null
- height System.Double? = null
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- description System.String = ""
public WordParagraph AddImageFromResource(Assembly assembly, String resourceName, Double? width = null, Double? height = null, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordParagraphAdd image from an embedded resource.
Parameters
- assembly System.Reflection.Assembly
- Assembly that contains the resource.
- resourceName System.String
- Full name of the embedded resource.
- width System.Double? = null
- Optional width of the image.
- height System.Double? = null
- Optional height of the image.
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- Optional text wrapping rule.
- description System.String = ""
- The description for this image.
Returns
The WordParagraph that AddImage was called on.
public WordParagraph AddImageVml(String filePathImage, Double? width = null, Double? height = null) #WordParagraphAdds a legacy VML image to the paragraph.
Parameters
- filePathImage System.String
- width System.Double? = null
- height System.Double? = null
public WordParagraph AddInsertedText(String text, String author, DateTime? date = null) #WordParagraphInserts revision text marked as added.
Parameters
- text System.String
- Text to insert.
- author System.String
- Revision author.
- date System.DateTime? = null
- Revision date. Uses current date when null.
Returns
The current WordParagraph instance.
public WordLine AddLine(Double startXPt, Double startYPt, Double endXPt, Double endYPt, String color = "#000000", Double strokeWeightPt = 1) #WordLineAdd a line shape to the paragraph.
Parameters
- startXPt System.Double
- Start X position in points.
- startYPt System.Double
- Start Y position in points.
- endXPt System.Double
- End X position in points.
- endYPt System.Double
- End Y position in points.
- color System.String = "#000000"
- Stroke color in hex format.
- strokeWeightPt System.Double = 1
- Stroke weight in points.
public WordLine AddLine(Double startXPt, Double startYPt, Double endXPt, Double endYPt, OfficeColor color, Double strokeWeightPt = 1) #WordLineAdd a line shape to the paragraph using OfficeColor.
Parameters
- startXPt System.Double
- startYPt System.Double
- endXPt System.Double
- endYPt System.Double
- color OfficeIMO.Drawing.OfficeColor
- strokeWeightPt System.Double = 1
public WordList AddList(WordListStyle style) #WordListAdd a list after this paragraph.
Parameters
- style OfficeIMO.Word.WordListStyle
- The style of this list.
Returns
The new list.
public WordParagraph AddPageNumber(Boolean includeTotalPages = false, WordFieldFormat? format = null, String separator = " of ") #WordParagraphAdds a page number field to the paragraph.
Parameters
- includeTotalPages System.Boolean = false
- If true adds a NUMPAGES field preceded by text " of ".
- format OfficeIMO.Word.WordFieldFormat? = null
- Optional field format to apply.
- separator System.String = " of "
- Text inserted between the current page and total pages fields.
Returns
The paragraph that this was called on.
public WordParagraph AddParagraph(WordParagraph? wordParagraph = null) #WordParagraphAdd 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.
Returns
The inserted WordParagraph.
public WordParagraph AddParagraph(String text) #WordParagraphAdd a paragraph with the given text to the end of the document.
Parameters
- text System.String
- The text to fill the paragraph with.
Returns
The appended WordParagraph.
public WordParagraph AddParagraphAfterSelf() #WordParagraphInsert a new paragraph after the WordParagraph AddParagraphAfterSelf is called on in the document.
Returns
The inserted WordParagraph
public WordParagraph AddParagraphAfterSelf(WordSection section, WordParagraph? paragraph = null) #WordParagraphAdd 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.
Returns
The new WordParagraph
public WordParagraph AddParagraphBeforeSelf() #WordParagraphAdd a paragraph before the paragraph that AddParagraphBeforeSelf was called on.
Returns
The inserted paragraph
public WordPictureControl AddPictureControl(String filePath, Double? width = null, Double? height = null, String? alias = null, String? tag = null) #WordPictureControlAdds a picture content control containing an image to the paragraph.
Parameters
- filePath System.String
- Image file path.
- width System.Double? = null
- Optional width of the image.
- height System.Double? = null
- Optional height of the image.
- alias System.String? = null
- Optional alias for the control.
- tag System.String? = null
- Optional tag for the control.
Returns
The created WordPictureControl instance.
public WordRepeatingSection AddRepeatingSection(String? sectionTitle = null, String? alias = null, String? tag = null) #WordRepeatingSectionAdds a repeating section content control to the paragraph.
Parameters
- sectionTitle System.String? = null
- Optional title of the repeating section.
- alias System.String? = null
- Optional alias for the control.
- tag System.String? = null
- Optional tag for the control.
Returns
The created WordRepeatingSection instance.
public WordShape AddShape(Double widthPt, Double heightPt, String fillColor = "#FFFFFF") #WordShapeAdd a rectangle shape to the paragraph.
Parameters
- widthPt System.Double
- Width in points.
- heightPt System.Double
- Height in points.
- fillColor System.String = "#FFFFFF"
- Fill color in hex format.
public WordShape AddShape(Double widthPt, Double heightPt, OfficeColor fillColor) #WordShapeAdd a rectangle shape to the paragraph using OfficeColor.
Parameters
- widthPt System.Double
- heightPt System.Double
- fillColor OfficeIMO.Drawing.OfficeColor
public WordShape AddShape(WordShapeType shapeType, Double widthPt, Double heightPt, String fillColor = "#FFFFFF", String strokeColor = "#000000", Double strokeWeightPt = 1, Double arcSize = 0.25) #WordShapeAdds a basic shape to the paragraph.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- Type of shape to create.
- widthPt System.Double
- Width in points or line end X.
- heightPt System.Double
- Height in points or line end Y.
- fillColor System.String = "#FFFFFF"
- Fill color in hex format.
- strokeColor System.String = "#000000"
- Stroke color in hex format.
- strokeWeightPt System.Double = 1
- Stroke weight in points.
- arcSize System.Double = 0.25
- Corner roundness fraction for rounded rectangles.
public WordShape AddShape(WordShapeType shapeType, Double widthPt, Double heightPt, OfficeColor fillColor, OfficeColor strokeColor, Double strokeWeightPt = 1, Double arcSize = 0.25) #WordShapeAdds a basic shape to the paragraph using OfficeColor values.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- widthPt System.Double
- heightPt System.Double
- fillColor OfficeIMO.Drawing.OfficeColor
- strokeColor OfficeIMO.Drawing.OfficeColor
- strokeWeightPt System.Double = 1
- arcSize System.Double = 0.25
public WordShape AddShapeDrawing(WordShapeType shapeType, Double widthPt, Double heightPt) #WordShapeAdds a DrawingML shape to the paragraph.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- Type of shape to create.
- widthPt System.Double
- Width in points.
- heightPt System.Double
- Height in points.
public WordShape AddShapeDrawing(WordShapeType shapeType, Double widthPt, Double heightPt, Double leftPt, Double topPt) #WordShapeAdds a DrawingML shape anchored at an absolute position on the page.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- Type of shape to create.
- widthPt System.Double
- Width in points.
- heightPt System.Double
- Height in points.
- leftPt System.Double
- Left offset from page in points.
- topPt System.Double
- Top offset from page in points.
public WordShapeGroup AddShapeGroup(IEnumerable<WordShapeGroupItem> items) #WordShapeGroupAdds an inline native DrawingML group of bounded preset shapes.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordShapeGroupItem>
public WordShapeGroup AddShapeGroup(IEnumerable<WordShapeGroupItem> items, Double leftPt, Double topPt) #WordShapeGroupAdds a native DrawingML shape group anchored at page-relative point offsets.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordShapeGroupItem>
- leftPt System.Double
- topPt System.Double
public WordSmartArt AddSmartArt(WordSmartArtType type) #WordSmartArtInserts a SmartArt diagram at the current position.
Parameters
- type OfficeIMO.Word.WordSmartArtType
- Layout of SmartArt to create.
Returns
The created WordSmartArt.
public WordStructuredDocumentTag AddStructuredDocumentTag(String text = "", String? alias = null, String? tag = null) #WordStructuredDocumentTagAdds a simple content control (structured document tag) to the paragraph.
Parameters
- text System.String = ""
- Initial text of the control.
- alias System.String? = null
- Optional alias for the content control.
- tag System.String? = null
- Optional tag for the content control.
Returns
The created WordStructuredDocumentTag instance.
public WordParagraph AddTab() #WordParagraphAdds a Tab to a paragraph
Returns
The paragraph this is called on.
public WordTable AddTableAfter(Int32 rows, Int32 columns, WordTableStyle tableStyle = TableGrid) #WordTableAdd a table after this paragraph and return the table.
Parameters
- rows System.Int32
- The number of rows in the table.
- columns System.Int32
- 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.
Returns
The new added table.
public WordTable AddTableBefore(Int32 rows, Int32 columns, WordTableStyle tableStyle = TableGrid) #WordTableAdd a table before this paragraph and return the table.
Parameters
- rows System.Int32
- The number of rows in this table
- columns System.Int32
- The number of columns in this table
- tableStyle OfficeIMO.Word.WordTableStyle = TableGrid
- The style of the table being added.
Returns
The new added table.
public WordTabStop AddTabStop(Int32 position, WordTabAlignment? alignment = null, WordTabLeader? leader = null) #WordTabStopProvides ability for configuration of Tabs in a paragraph by adding one or more TabStops
Parameters
- position System.Int32
- The position of the tabs in the paragraph.
- alignment OfficeIMO.Word.WordTabAlignment? = null
- The optional alignment for the tabs.
- leader OfficeIMO.Word.WordTabLeader? = null
- The optional rune to use before the tabs.
Returns
The added tabs.
public WordParagraph AddText(String? text) #WordParagraphAdd a text to existing paragraph
Parameters
- text System.String?
- The text to be added to the paragraph.
Returns
The paragraph containing the new text.
public WordTextBox AddTextBox(String text, WordImageTextWrapping wrapTextImage) #WordTextBoxAdd a text box to the document.
Parameters
- text System.String
- The text inside the text box.
- wrapTextImage OfficeIMO.Word.WordImageTextWrapping
- The text image wrapping settings.
public WordTextBox AddTextBoxVml(String text) #WordTextBoxAdds a legacy VML text box to the paragraph.
Parameters
- text System.String
public WordParagraph ClearTabStops() #WordParagraphRemoves this paragraph's explicit tab stops, leaving inherited defaults unchanged.
public Boolean Equals(WordParagraph? other) #BooleanDetermines whether the specified WordParagraph is equal to the current instance.
Parameters
- other OfficeIMO.Word.WordParagraph?
- The paragraph to compare with the current instance.
Returns
true if the paragraphs are equal; otherwise, false.
public override Boolean Equals(Object? obj) #BooleanDetermines whether the specified object is equal to the current instance.
Parameters
- obj System.Object?
- The object to compare with the current instance.
Returns
true if the objects are equal; otherwise, false.
public Double GetContentWidthPoints() #DoubleEstimates the authored content width available to an inline drawing in this paragraph, in points.
Returns
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() #IEnumerable<WordFormattedRun>Enumerates this paragraph's text and image runs with reader-facing formatting metadata.
Returns
Formatted runs in document order.
public override Int32 GetHashCode() #Int32Serves as the default hash function.
Returns
A hash code for the current object.
public WordListStyle? GetListStyle() #WordListStyle?Gets the list style when this paragraph is part of a list.
public IEnumerable<WordParagraph> GetRuns() #IEnumerable<WordParagraph>Enumerates visible runs in paragraph order, including cached simple-field results and hyperlink runs.
public WordImage InsertImage(String filePathImage, Double? width = null, Double? height = null, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordImageInserts an image and returns the created WordImage for immediate configuration. This is a convenience alternative to WordParagraph.AddImage when you want to set properties on the inserted image without accessing WordParagraph.Image.
Parameters
- filePathImage System.String
- width System.Double? = null
- height System.Double? = null
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- description System.String = ""
public WordImage InsertImage(Stream imageStream, String fileName, Double? width = null, Double? height = null, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordImageInserts an image from a stream and returns the created WordImage.
Parameters
- imageStream System.IO.Stream
- fileName System.String
- width System.Double? = null
- height System.Double? = null
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- description System.String = ""
public WordImage InsertImage(Uri imageUri, Double width, Double height, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordImageInserts an external image (by URI) and returns the created WordImage.
Parameters
- imageUri System.Uri
- width System.Double
- height System.Double
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- description System.String = ""
public WordImage InsertImageFromBase64(String base64String, String fileName, Double? width = null, Double? height = null, WordImageTextWrapping wrapImageText = InLineWithText, String description = "") #WordImageInserts an image from a Base64 payload and returns the created WordImage.
Parameters
- base64String System.String
- fileName System.String
- width System.Double? = null
- height System.Double? = null
- wrapImageText OfficeIMO.Word.WordImageTextWrapping = InLineWithText
- description System.String = ""
public static Boolean op_Equality(WordParagraph? left, WordParagraph? right) #BooleanDetermines whether two WordParagraph instances are equal.
Parameters
- left OfficeIMO.Word.WordParagraph?
- The left-hand instance.
- right OfficeIMO.Word.WordParagraph?
- The right-hand instance.
Returns
true if the instances are equal; otherwise, false.
public static Boolean op_Inequality(WordParagraph? left, WordParagraph? right) #BooleanDetermines 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
true if the instances are not equal; otherwise, false.
public Void Remove() #VoidRemove the paragraph from WordDocument
Exceptions
InvalidOperationException
public Void RemoveHyperLink(Boolean includingParagraph = false) #VoidRemoves hyperlink from this paragraph and detaches its relationship.
Parameters
- includingParagraph System.Boolean = false
- If true removes the paragraph when it becomes empty.
public WordParagraph SetAlignment(WordParagraphAlignment alignment) #WordParagraphSets the paragraph alignment.
Parameters
- alignment OfficeIMO.Word.WordParagraphAlignment
- Alignment value.
Returns
The current paragraph instance.
public WordParagraph SetBold(Boolean isBold = true) #WordParagraphSets the WordParagraph.Bold property.
Parameters
- isBold System.Boolean = true
- Whether the text should be bold.
Returns
The current paragraph instance.
public WordParagraph SetCapsStyle(WordCapsStyle capsStyle) #WordParagraphSets the capitalization style for the text.
Parameters
- capsStyle OfficeIMO.Word.WordCapsStyle
- Capitalization style.
Returns
The current paragraph instance.
public WordParagraph SetCharacterStyle(WordCharacterStyles style) #WordParagraphSets the character style for the run.
Parameters
- style OfficeIMO.Word.WordCharacterStyles
- Character style to apply.
Returns
The current paragraph instance.
public WordParagraph SetCharacterStyleId(String styleId) #WordParagraphSets the character style by identifier.
Parameters
- styleId System.String
- The style identifier.
Returns
The current paragraph instance.
public Void SetCheckBoxValue(Boolean value) #VoidSets the checked state of the paragraph's checkbox.
Parameters
- value System.Boolean
- New checked state.
public WordParagraph SetColor(OfficeColor color) #WordParagraphSets the text color using OfficeColor.
Parameters
- color OfficeIMO.Drawing.OfficeColor
- The color to apply.
Returns
The current paragraph instance.
public WordParagraph SetColorHex(String color) #WordParagraphSets the text color using a hexadecimal value.
Parameters
- color System.String
- Color in hexadecimal format.
Returns
The current paragraph instance.
public WordParagraph SetDoubleStrike(Boolean isDoubleStrike = true) #WordParagraphEnables or disables double strikethrough on the text.
Parameters
- isDoubleStrike System.Boolean = true
- Whether the text should be double struck.
Returns
The current paragraph instance.
public WordParagraph SetEmboss(Boolean isEmboss = true) #WordParagraphEnables or disables emboss effect on the text.
Parameters
- isEmboss System.Boolean = true
- Whether the text should be embossed.
Returns
The current paragraph instance.
public WordParagraph SetFontFamily(String fontFamily) #WordParagraphSets the font family for the text.
Parameters
- fontFamily System.String
- Name of the font family.
Returns
The current paragraph instance.
public WordParagraph SetFontSize(Int32 fontSize) #WordParagraphSets the font size for the text.
Parameters
- fontSize System.Int32
- Font size in points.
Returns
The current paragraph instance.
public WordParagraph SetHighlight(WordHighlightColor highlight) #WordParagraphSets the highlight color for the text.
Parameters
- highlight OfficeIMO.Word.WordHighlightColor
- Highlight color.
Returns
The current paragraph instance.
public WordParagraph SetItalic(Boolean isItalic = true) #WordParagraphSets the WordParagraph.Italic property.
Parameters
- isItalic System.Boolean = true
- Whether the text should be italic.
Returns
The current paragraph instance.
public WordParagraph SetLanguage(String language) #WordParagraphSets the language for the text run.
Parameters
- language System.String
- Language tag, such as en-US or pl-PL.
Returns
The current paragraph instance.
public WordParagraph SetOutline(Boolean isOutline = true) #WordParagraphEnables or disables outline effect on the text.
Parameters
- isOutline System.Boolean = true
- Whether the text should be outlined.
Returns
The current paragraph instance.
public WordParagraph SetRunShadingFillColorHex(String color) #WordParagraphApplies an exact hexadecimal fill color to the current text run.
Parameters
- color System.String
- Color in hexadecimal format.
Returns
The current paragraph or run wrapper.
public WordParagraph SetShadow(Boolean isShadow = true) #WordParagraphEnables or disables shadow effect on the text.
Parameters
- isShadow System.Boolean = true
- Whether the text should have a shadow.
Returns
The current paragraph instance.
public WordParagraph SetSmallCaps(Boolean isSmallCaps = true) #WordParagraphEnables or disables small caps formatting on the text.
Parameters
- isSmallCaps System.Boolean = true
- Whether the text should use small caps.
Returns
The current paragraph instance.
public WordParagraph SetSpacing(Int32 spacing) #WordParagraphSets the character spacing for the text.
Parameters
- spacing System.Int32
- Spacing value in twentieths of a point.
Returns
The current paragraph instance.
public WordParagraph SetStrike(Boolean isStrike = true) #WordParagraphEnables or disables single strikethrough on the text.
Parameters
- isStrike System.Boolean = true
- Whether the text should be struck through.
Returns
The current paragraph instance.
public WordParagraph SetStyle(WordParagraphStyles style) #WordParagraphSets the paragraph style.
Parameters
- style OfficeIMO.Word.WordParagraphStyles
- The style to apply.
Returns
The current paragraph instance.
public WordParagraph SetStyleId(String styleId) #WordParagraphSets the paragraph style by identifier.
Parameters
- styleId System.String
- The style identifier.
Returns
The current paragraph instance.
Examples
Style style = new() {
Type = StyleValues.Paragraph,
StyleId = "MyStyle"
};
WordParagraphStyle.RegisterCustomStyle("MyStyle", style);
document.AddParagraph("Hello world").SetStyleId("MyStyle");
public WordParagraph SetText(String text) #WordParagraphSets the paragraph text.
Parameters
- text System.String
- The text content.
Returns
The current paragraph instance.
public WordParagraph SetUnderline(WordUnderlineStyle underline) #WordParagraphSets the underline style for the text.
Parameters
- underline OfficeIMO.Word.WordUnderlineStyle
- Underline style.
Returns
The current paragraph instance.
public WordParagraph SetVerticalTextAlignment(WordVerticalTextPosition? verticalPositionValue) #WordParagraphSet the vertical text alignment
Parameters
- verticalPositionValue OfficeIMO.Word.WordVerticalTextPosition?
public WordParagraph TransformTextCase(OfficeTextCase textCase, CultureInfo? culture = null) #WordParagraphChanges 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.
Returns
The current paragraph instance.
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 Boolean 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 Int32? 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 Boolean IsStructuredDocumentTag { get; } #Gets a value indicating whether the paragraph holds a structured document tag.
public Boolean IsCheckBox { get; } #Gets a value indicating whether the paragraph contains a checkbox control.
public Boolean IsDatePicker { get; } #Gets a value indicating whether the paragraph contains a date picker control.
public Boolean IsDropDownList { get; } #Gets a value indicating whether the paragraph contains a dropdown list control.
public Boolean IsComboBox { get; } #Gets a value indicating whether the paragraph contains a combo box control.
public Boolean IsPictureControl { get; } #Gets a value indicating whether the paragraph contains a picture control.
public Boolean 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 Boolean IsLastRun { get; } #Gets a value indicating whether this run is the last run within its parent container.
public Boolean IsFirstRun { get; } #Gets a value indicating whether this run is the first run within its parent container.
public Boolean IsListItem { get; } #Gets a value indicating whether this paragraph is part of a numbered or bulleted list.
public Int32? 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 Boolean IsImage { get; } #Gets a value indicating whether an image is found in the paragraph.
public Boolean IsEmbeddedObject { get; } #Gets a value indicating whether the paragraph has an embedded object.
public Boolean IsChart { get; } #Gets a value indicating whether a chart is associated with the paragraph.
public Boolean 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 Boolean IsTextBox { get; } #Gets a value indicating whether the paragraph contains a text box.
public Boolean IsShape { get; } #Gets a value indicating whether the paragraph contains a shape.
public Boolean IsLine { get; } #Gets a value indicating whether the paragraph contains a VML line shape.
public Boolean? PageBreakBeforeOverride { get; set; } #Gets or sets directly authored page-break-before formatting. Null restores style inheritance; false overrides an enabled style.
public Boolean? KeepWithNextOverride { get; set; } #Gets or sets directly authored keep-with-next formatting. Null restores style inheritance; false overrides an enabled style.
public Boolean? KeepLinesTogetherOverride { get; set; } #Gets or sets directly authored keep-lines-together formatting. Null restores style inheritance; false overrides an enabled style.
public Boolean? AvoidWidowAndOrphanOverride { get; set; } #Gets or sets directly authored widow/orphan control. Null restores style inheritance; false disables the control.
public Boolean? ContextualSpacing { get; set; } #Gets or sets suppression of spacing between paragraphs of the same style. Null restores style inheritance.
public Boolean? 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 Boolean? SuppressAutoHyphens { get; set; } #Gets or sets paragraph automatic-hyphenation suppression. Null restores style inheritance. Automatic Word hyphenation is not supplied by this property.
public Boolean? 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 Int32? 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 Double? KerningMinimumFontSizePoints { 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 Int32? IndentationBefore { get; set; } #Gets or sets the indentation before the paragraph in twips (1/20 of a point).
public Double? IndentationBeforePoints { get; set; } #Gets or sets the indentation before in points.
public Int32? IndentationAfter { get; set; } #Gets or sets the indentation after the paragraph in twips (1/20 of a point).
public Double? IndentationAfterPoints { get; set; } #Gets or sets the indentation after in points.
public Boolean PageBreakBefore { get; set; } #Gets or sets a directly authored page-break-before value; this does not resolve inherited paragraph styles.
public Boolean KeepWithNext { get; set; } #Gets or sets directly authored keep-with-next formatting without resolving paragraph styles.
public Boolean KeepLinesTogether { get; set; } #Gets or sets directly authored keep-lines-together formatting without resolving paragraph styles.
public Boolean AvoidWidowAndOrphan { get; set; } #Gets or sets directly authored widow and orphan control without resolving paragraph styles.
public Int32? IndentationFirstLine { get; set; } #Gets or sets the first line indentation in twips (1/20 of a point).
public Double? IndentationFirstLinePoints { get; set; } #Gets or sets the first line indentation in points.
public Int32? IndentationHanging { get; set; } #Gets or sets the hanging indentation in twips (1/20 of a point).
public Double? IndentationHangingPoints { get; set; } #Gets or sets the hanging indentation in points.
public WordTextDirection? TextDirection { get; set; } #Gets or sets the text flow direction for the paragraph.
public Boolean BiDi { get; set; } #Gets or sets directly authored right-to-left layout without resolving paragraph styles.
public WordLineSpacingRule? LineSpacingRule { get; set; } #Gets or sets the rule used to calculate line spacing for the paragraph.
public Int32? LineSpacing { get; set; } #Gets or sets the authored line-spacing value. Automatic spacing uses 240ths of a line; exact and minimum spacing use twips (1/20 of a point).
public Double? LineSpacingPoints { get; set; } #Gets or sets the authored line-spacing value converted from twips to points. Setting a point value selects exact spacing when no rule is declared. With automatic spacing, use WordParagraph.LineSpacing for the line multiplier.
public Int32? LineSpacingBefore { get; set; } #Gets or sets the spacing before the paragraph in twips (1/20 of a point).
public Double? LineSpacingBeforePoints { get; set; } #Gets or sets the line spacing before in points.
public Int32? LineSpacingAfter { get; set; } #Gets or sets the spacing after the paragraph in twips (1/20 of a point).
public Double? LineSpacingAfterPoints { get; set; } #Gets or sets the line spacing after in points.
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 Boolean IsHyperLink { get; } #Gets a value indicating whether the paragraph contains a hyperlink.
public Boolean IsField { get; } #Gets a value indicating whether the paragraph hosts a field code.
public Boolean IsBookmark { get; } #Gets a value indicating whether the paragraph includes a bookmark start tag.
public Boolean IsEquation { get; } #Gets a value indicating whether the paragraph contains an equation.
public Boolean IsEndNote { get; } #Gets a value indicating whether an endnote reference is present in the paragraph.
public Boolean IsFootNote { get; } #Gets a value indicating whether a footnote reference is present in the paragraph.
public Boolean IsEmpty { get; } #Gets a value indicating whether the paragraph contains no run element.
public Boolean IsPageBreak { get; } #Gets a value indicating whether the paragraph contains a page break.
public Boolean IsColumnBreak { get; } #Gets a value indicating whether the paragraph contains a column break.
public Boolean IsBreak { get; } #Gets a value indicating whether the paragraph contains a break element.
public Boolean Bold { get; set; } #Gets or sets a value indicating whether the run is bold.
public Boolean Italic { get; set; } #Gets or sets a value indicating whether the run is italic.
public WordUnderlineStyle? Underline { get; set; } #Gets or sets the underline style for the run.
public Boolean DoNotCheckSpellingOrGrammar { get; set; } #Gets or sets a value indicating whether spelling and grammar checks are disabled.
public Int32? Spacing { get; set; } #Gets or sets the character spacing value in twentieths of a point.
public Boolean Strike { get; set; } #Gets or sets a value indicating whether the run is struck through.
public Boolean DoubleStrike { get; set; } #Gets or sets a value indicating whether the run has a double strikethrough.
public Boolean Outline { get; set; } #Gets or sets a value indicating whether the run text is outlined.
public Boolean Shadow { get; set; } #Gets or sets a value indicating whether the run has a shadow effect.
public Boolean Emboss { get; set; } #Gets or sets a value indicating whether the run is embossed.
public Int32? FontSize { get; set; } #Gets or sets the font size in points.
public Double? FontSizePoints { 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 String ColorHex { get; set; } #Gets or sets the text color as a hexadecimal string.
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 String RunShadingFillColorHex { get; set; } #Gets or sets the exact fill color applied to the current text run.
public OfficeColor? RunShadingFillColor { get; set; } #Gets or sets the exact fill color applied to the current text run.
public String ShadingFillColorHex { get; set; } #Get or set the paragraph shading fill color using hexadecimal value.
public OfficeColor? ShadingFillColor { get; set; } #Get or set the paragraph shading fill color.
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 Boolean 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) #StringReturns the raw Open XML string representing the paragraph.
Parameters
- paragraph OfficeIMO.Word.WordParagraph
- Paragraph to convert.
Returns
Outer XML of the underlying Open XML element.