共用方式為


DocumentBase.TextLineEnding Property

Definition

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

public:
 property Microsoft::Office::Interop::Word::WdLineEndingType TextLineEnding { Microsoft::Office::Interop::Word::WdLineEndingType get(); void set(Microsoft::Office::Interop::Word::WdLineEndingType value); };
public Microsoft.Office.Interop.Word.WdLineEndingType TextLineEnding { get; set; }
member this.TextLineEnding : Microsoft.Office.Interop.Word.WdLineEndingType with get, set
Public Property TextLineEnding As WdLineEndingType

Property Value

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 void DocumentTextLineEnding()
{
    this.TextLineEnding = Word.WdLineEndingType.wdCROnly;
}
Private Sub DocumentTextLineEnding()
    Me.TextLineEnding = Word.WdLineEndingType.wdCROnly
End Sub 

Applies to