This documentation is archived and is not being maintained.

DocumentBase.SummaryLength Property

Gets or sets the length of the summary as a percentage of the document length.

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

public int SummaryLength { get; set; }

Property Value

Type: System.Int32
The length of the summary as a percentage of the document length.

The larger the number, the more detail is included in the summary.

This property takes effect immediately if the AutoSummarize toolbar is displayed; otherwise, it takes effect the next time the AutoSummarize method or the SummaryViewMode property is applied to the document.

The following code example adds text to the first paragraph of the document. The code then displays the summary and sets the level of detail to 50 percent. To use this example, run it from the ThisDocument class in a document-level project.

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;
}

Show: