DocumentBase.TextLineEnding 屬性

取得或設定 WdLineEndingType 常數,表示 Microsoft Office Word 如何在儲存為文字檔的文件中標示分行符號或段落符號。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

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

屬性值

型別:Microsoft.Office.Interop.Word.WdLineEndingType
其中一個 WdLineEndingType 值。

範例

下列範例顯示當文件儲存為文字檔時,程式碼設定文件使其針對分行符號或段落符號輸入歸位字元 (Carriage Return)。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

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

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間