DocumentBase.TextLineEnding Property

Gets or sets a WdLineEndingType constant indicating how Microsoft Office Word marks the line and paragraph breaks in documents saved as text files.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

'Declaration
Public Property TextLineEnding As WdLineEndingType
    Get
    Set
public WdLineEndingType TextLineEnding { get; set; }

Property Value

Type: Microsoft.Office.Interop.Word.WdLineEndingType
One of the WdLineEndingType values.

Examples

The following code example sets the document to enter a carriage return for line and paragraph breaks when the document is saved as a text file. To use this example, run it from the ThisDocument class in a document-level project.

Private Sub DocumentTextLineEnding()
    Me.TextLineEnding = Word.WdLineEndingType.wdCROnly
End Sub 
private void DocumentTextLineEnding()
{
    this.TextLineEnding = Word.WdLineEndingType.wdCROnly;
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace