DocumentBase.SummaryLength 屬性

取得或設定摘要長度,此長度和文件長度成比例。

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

語法

'宣告
Public Property SummaryLength As Integer
public int SummaryLength { get; set; }

屬性值

類型:System.Int32
摘要長度,此長度和文件長度成比例。

備註

數字越大,摘要內容就越詳細。

如果已顯示 [自動摘要] 工具列,此屬性會立即生效,否則,要到下一次將 AutoSummarize 方法或 SummaryViewMode 屬性套用至文件時才生效。

範例

下列程式碼範例會將文字加入至文件的第一個段落。 然後程式碼會顯示摘要,並且將詳細程度設定為百分之 50。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub DocumentSummaryLength()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.Text = "The SummaryLength property" & _
        " returns or sets the length of the summary as a " & _
        " percentage of the document length. The larger the number," & _
        " the more detail that's included in the summary."

    Me.SummaryViewMode = Word.WdSummaryMode.wdSummaryModeHighlight

    Me.ShowSummary = True
    Me.SummaryLength = 50
End Sub 
private void DocumentSummaryLength()
{

    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.Text = "The SummaryLength property"
        + " returns or sets the length of the summary as a "
        + " percentage of the document length. The larger the number,"
        + " the more detail that's included in the summary.";

    this.SummaryViewMode = Word.WdSummaryMode.wdSummaryModeHighlight;

    this.ShowSummary = true;
    this.SummaryLength = 50;
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間