Back to Devexpress

Document.Hyphenation Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-b8ebfd87.md

latest5.5 KB
Original Source

Document.Hyphenation Property

Gets or sets whether to enable hyphenation in a document.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
bool Hyphenation { get; set; }
vb
Property Hyphenation As Boolean

Property Value

TypeDescription
Boolean

true , to enable hyphenation; otherwise, false.

|

Remarks

Set the Hyphenation property to true to hyphenate all text in the document. Use the Document.HyphenateCaps property to determine whether to hyphenate words in CAPS.

Provide the hyphenation dictionary to automatically hyphenate words in a document. Otherwise, the Hyphenation property has no effect.

The following properties provide access to the component’s collection of hyphenation dictionaries:

Use an OpenOfficeHyphenationDictionary class object to add an OpenOffice hyphenation dictionary to the component. The CustomHyphenationDictionary class represents hyphenation pattern files containing words divided into syllables, (e.g., hy-phen-ation).

The code sample below shows how to add an OpenOffice dictionary to the component and enable hyphenation:

csharp
OpenOfficeHyphenationDictionary hyphenationDictionary = new OpenOfficeHyphenationDictionary("hyph_sl_SI.dic", new System.Globalization.CultureInfo("sl-SL"));
server.HyphenationDictionaries.Add(hyphenationDictionary);

server.Document.Hyphenation = true;
vb
Dim hyphenationDictionary As OpenOfficeHyphenationDictionary = New OpenOfficeHyphenationDictionary("hyph_sl_SI.dic", New System.Globalization.CultureInfo("sl-SL"))
server.HyphenationDictionaries.Add(hyphenationDictionary)

server.Document.Hyphenation = True

The following code snippets (auto-collected from DevExpress Examples) contain references to the Hyphenation 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.

word-document-api-enable-automatic-hyphenation/CS/Program.cs#L35

csharp
//Specify hyphenation settings
wordProcessor.Document.Hyphenation = true;
wordProcessor.Document.HyphenateCaps = true;

winforms-richedit-link-hyphenation-dictionaries/CS/Form1.cs#L51

csharp
//Enable automatic hyphenation
    document.Hyphenation = true;
}

wpf-richedit-link-hyphenation-dictionaries/CS/DXRichEdit/MainWindow.xaml.cs#L26

csharp
richEditControl1.Document.Hyphenation = true;
}

word-document-api-enable-automatic-hyphenation/VB/Program.vb#L31

vb
'Specify hyphenation settings
wordProcessor.Document.Hyphenation = True
wordProcessor.Document.HyphenateCaps = True

winforms-richedit-link-hyphenation-dictionaries/VB/Form1.vb#L49

vb
'Enable automatic hyphenation
    document.Hyphenation = True
End Sub

wpf-richedit-link-hyphenation-dictionaries/VB/DXRichEdit/MainWindow.xaml.vb#L25

vb
richEditControl1.Document.Hyphenation = True
End Sub

See Also

Document Interface

Document Members

DevExpress.XtraRichEdit.API.Native Namespace