officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraphcollection.md
Appends a new Paragraph to the document.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
Paragraph Append()
Function Append As Paragraph
| Type | Description |
|---|---|
| Paragraph |
A Paragraph object that is the newly added paragraph.
|
The code sample below appends a paragraph and inserts a paragraph at the start of the second section:
using DevExpress.XtraRichEdit.API.Native;
using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
wordProcessor.LoadDocument("FirstLook.docx");
Document document = wordProcessor.Document;
document.BeginUpdate();
//Append paragraph:
Paragraph appendedParagraph = document.Paragraphs.Append();
document.InsertText(appendedParagraph.Range.Start, "Appended paragraph");
//Insert paragraph at the start of the second section:
Paragraph paragraph = document.Paragraphs.Insert(document.Sections[1].Range.Start);
document.InsertText(document.Paragraphs[paragraph.Index - 1].Range.Start,
"Inserted paragraph");
document.EndUpdate();
}
Imports DevExpress.XtraRichEdit.API.Native
Using wordProcessor As New RichEditDocumentServer()
wordProcessor.LoadDocument("FirstLook.docx")
Dim document As Document = wordProcessor.Document
document.BeginUpdate()
'Append paragraph:
Dim appendedParagraph As Paragraph = document.Paragraphs.Append()
document.InsertText(appendedParagraph.Range.Start, "Appended paragraph")
'Insert paragraph at the start of the second section:
document.InsertText(document.Paragraphs[paragraph.Index - 1].Range.Start
"Inserted paragraph");
document.InsertText(paragraph.Range.Start, "Inserted paragraph")
document.EndUpdate()
End Using
The following code snippets (auto-collected from DevExpress Examples) contain references to the Append() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
word-document-api-examples/CS/CodeExamples/BookmarksAndHyperlinks.cs#L29
// Create a hyperlink that navigates to the created bookmark.
wordProcessor.Document.Paragraphs.Append();
DocumentRange hyperlinkRange = wordProcessor.Document.AppendText("get to the top");
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Range.cs#L38
string s2 = String.Format("Range r2 starts at {0}, ends at {1}", r2.Start, r2.End);
document.Paragraphs.Append();
document.AppendText(s1);
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/RangeActions.cs#L38
string s2 = String.Format("Range r2 starts at {0}, ends at {1}", r2.Start, r2.End);
document.Paragraphs.Append();
document.AppendText(s1);
word-document-api-insert-dynamic-content/CS/Program.cs#L72
{
Paragraph paragraph = document.Paragraphs.Append();
paragraph.LineSpacing = 1f;
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Range.vb#L35
Dim s2 As String = System.[String].Format("Range r2 starts at {0}, ends at {1}", r2.Start, r2.[End])
document.Paragraphs.Append()
document.AppendText(s1)
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/RangeActions.vb#L33
Dim s2 As String = String.Format("Range r2 starts at {0}, ends at {1}", r2.Start, r2.End)
document.Paragraphs.Append()
document.AppendText(s1)
word-document-api-examples/VB/CodeExamples/BookmarksAndHyperlinks.vb#L29
' Create a hyperlink that navigates to the created bookmark.
document.Paragraphs.Append()
Dim hyperlinkRange As DocumentRange = wordProcessor.Document.AppendText("get to the top")
word-document-api-invoke-print-preview-dialog/VB/Form1.vb#L31
richServer.Document.AppendText("This content is created programmatically" & Microsoft.VisualBasic.Constants.vbLf)
richServer.Document.Paragraphs.Append()
'Create a table
word-document-api-insert-dynamic-content/VB/Module1.vb#L60
Private Sub AddSyndicationItem(ByVal document As Document, ByVal item As SyndicationItem)
Dim paragraph As Paragraph = document.Paragraphs.Append()
paragraph.LineSpacing = 1.0F
See Also