officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-table-77b7619c.md
Specifies the text wrapping type.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
TableTextWrappingType TextWrappingType { get; set; }
Property TextWrappingType As TableTextWrappingType
| Type | Description |
|---|---|
| TableTextWrappingType |
An enumeration value that indicates which text wrapping is used.
|
Available values:
| Name | Description |
|---|---|
| None |
The text is not wrapped around the table.
| | Around |
The text is wrapped around the table.
|
Note
You can specify the TextWrappingType property for tables in the main body, headers or footers only.
Set the TextWrappingType property to TableTextWrappingType.Around to wrap text around the table and use the following properties to specify the table position:
Horizontal position:
Vertical position:
Distance from surrounding text:
The code sample below shows how to wrap text around a table and specify its position:
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.Office.Utils;
using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
Document document = wordProcessor.Document;
Table table = document.Tables[0];
table.BeginUpdate();
// Wrap text around the table
table.TextWrappingType = TableTextWrappingType.Around;
// Specify vertical alignment:
table.RelativeVerticalPosition = TableRelativeVerticalPosition.Paragraph;
table.VerticalAlignment = TableVerticalAlignment.None;
table.OffsetYRelative = Units.InchesToDocumentsF(2f);
// Specify horizontal alignment:
table.RelativeHorizontalPosition = TableRelativeHorizontalPosition.Margin;
table.HorizontalAlignment = TableHorizontalAlignment.Center;
// Set distance between the text and the table:
table.MarginBottom = Units.InchesToDocumentsF(0.3f);
table.MarginLeft = Units.InchesToDocumentsF(0.3f);
table.MarginTop = Units.InchesToDocumentsF(0.3f);
table.MarginRight = Units.InchesToDocumentsF(0.3f);
table.EndUpdate();
}
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
Imports DevExpress.Office.Utils
Using wordProcessor As New RichEditDocumentServer()
Dim document As Document = wordProcessor.Document
Dim table As Table = document.Tables(0)
table.BeginUpdate()
' Wrap text around the table
table.TextWrappingType = TableTextWrappingType.Around
' Specify vertical alignment:
table.RelativeVerticalPosition = TableRelativeVerticalPosition.Paragraph
table.VerticalAlignment = TableVerticalAlignment.None
table.OffsetYRelative = Units.InchesToDocumentsF(2F)
' Specify horizontal alignment:
table.RelativeHorizontalPosition = TableRelativeHorizontalPosition.Margin
table.HorizontalAlignment = TableHorizontalAlignment.Center
' Set distance between the text and the table:
table.MarginBottom = Units.InchesToDocumentsF(0.3F)
table.MarginLeft = Units.InchesToDocumentsF(0.3F)
table.MarginTop = Units.InchesToDocumentsF(0.3F)
table.MarginRight = Units.InchesToDocumentsF(0.3F)
table.EndUpdate()
End Using
The following code snippets (auto-collected from DevExpress Examples) contain references to the TextWrappingType property.
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.
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Table.cs#L269
table.BeginUpdate();
table.TextWrappingType = TableTextWrappingType.Around;
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/TableActions.cs#L272
table.BeginUpdate();
table.TextWrappingType = TableTextWrappingType.Around;
winforms-richedit-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L83
// Wrap text around the table
table.TextWrappingType = TableTextWrappingType.Around;
word-document-api-examples/CS/CodeExamples/TablesActions.cs#L382
// Specifies the text wrapping type.
table.TextWrappingType = TableTextWrappingType.Around;
word-document-api-table-examples/CS/Program.cs#L218
//Wrap text around the table
table.TextWrappingType = TableTextWrappingType.Around;
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Table.vb#L242
table.BeginUpdate()
table.TextWrappingType = DevExpress.XtraRichEdit.API.Native.TableTextWrappingType.Around
'Specify vertical alignment:
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/TableActions.vb#L241
table.BeginUpdate()
table.TextWrappingType = TableTextWrappingType.Around
winforms-richedit-tables-simple-example/VB/TablesSimpleExample/Form1.vb#L68
' Wrap text around the table
table.TextWrappingType = TableTextWrappingType.Around
' Specify vertical alignment:
word-document-api-examples/VB/CodeExamples/TablesActions.vb#L324
' Specifies the text wrapping type.
table.TextWrappingType = DevExpress.XtraRichEdit.API.Native.TableTextWrappingType.Around
' Specify vertical alignment.
word-document-api-table-examples/VB/Program.vb#L176
'Wrap text around the table
table.TextWrappingType = TableTextWrappingType.Around
'Specify vertical alignment:
See Also