FindReplaceOptionsApplyParagraphFormat Property

Paragraph formatting applied to new content.

Namespace:  Aspose.Words.Replacing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public ParagraphFormat ApplyParagraphFormat { get; }

Property Value

Type: ParagraphFormat
Examples
Shows how to affect the format of paragraphs with successful replacements.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Writeln("Every paragraph that ends with a full stop like this one will be right aligned.");
builder.Writeln("This one will not!");
builder.Writeln("And this one will.");

FindReplaceOptions options = new FindReplaceOptions();
options.ApplyParagraphFormat.Alignment = ParagraphAlignment.Right;

int count = doc.Range.Replace(".&p", "!&p", options);
Assert.AreEqual(2, count);

doc.Save(ArtifactsDir + "Range.ApplyParagraphFormat.docx");
See Also