Method ApplyFormatting
ApplyFormatting(Paragraph, ParagraphFormat)
Layers direct paragraph formatting onto a paragraph. Only the values
formatting specifies are written.
public static Paragraph ApplyFormatting(this Paragraph paragraph, ParagraphFormat formatting)
Parameters
paragraphParagraphThe paragraph.
formattingParagraphFormatThe values to apply.
Returns
- Paragraph
The same paragraph, so calls chain.
Exceptions
- ArgumentNullException
An argument is null.
ApplyFormatting(RunContentInline, CharacterFormat)
Layers direct run formatting onto one run-content inline. Only the values
formatting specifies are written.
public static RunContentInline ApplyFormatting(this RunContentInline inline, CharacterFormat formatting)
Parameters
inlineRunContentInlineThe run-content inline.
formattingCharacterFormatThe values to apply.
Returns
- RunContentInline
The same inline, so calls chain.
Exceptions
- ArgumentNullException
An argument is null.
ApplyFormatting(DocumentRange, CharacterFormat)
Layers direct run formatting onto every run-content inline in a range, recursing into nested content.
public static int ApplyFormatting(this DocumentRange range, CharacterFormat formatting)
Parameters
rangeDocumentRangeThe range.
formattingCharacterFormatThe values to apply.
Returns
- int
The number of inlines the formatting was applied to.
Exceptions
- ArgumentNullException
An argument is null.
ApplyFormatting(DocumentRange, ParagraphFormat)
Layers direct paragraph formatting onto every paragraph in a range, including paragraphs nested inside tables and content controls.
public static int ApplyFormatting(this DocumentRange range, ParagraphFormat formatting)
Parameters
rangeDocumentRangeThe range.
formattingParagraphFormatThe values to apply.
Returns
- int
The number of paragraphs the formatting was applied to.
Exceptions
- ArgumentNullException
An argument is null.