DocumentBase.AutoSummarize Method
Creates an automatic summary of the document.
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 Function AutoSummarize ( _
ByRef length As Object, _
ByRef mode As Object, _
ByRef updateProperties As Object _
) As Range
public Range AutoSummarize(
ref Object length,
ref Object mode,
ref Object updateProperties
)
Parameters
length
Type: System.Object%The length of the summary as a percentage of the total document length (the larger the number, the more detail is included in the summary).
mode
Type: System.Object%One of the WdSummaryMode values that specifies the way the summary is displayed.
updateProperties
Type: System.Object%true to update the Keyword and Comments boxes in the Properties dialog box to reflect the content of the summary for the document.
Return Value
Type: Microsoft.Office.Interop.Word.Range
A Range that includes the summary of the document.
Remarks
The values of the Mode parameter correspond to the options in the AutoSummarize dialog box.
Optional Parameters
For information on optional parameters, see Optional Parameters in Office Solutions.
Examples
The following code example uses the AutoSummarize method to create an automatic summary of the active document by creating a new document and inserting the specified summary. This example assumes that the current document is not empty. To use this example, run it from the ThisDocument class in a document-level project.
Private Function DocumentAddSummary() As Word.Range
Return Me.AutoSummarize(Length:=30, _
Mode:=Word.WdSummaryMode.wdSummaryModeCreateNew, _
UpdateProperties:=True)
End Function
private Word.Range DocumentAddSummary()
{
object length = 30;
object mode = Word.WdSummaryMode.wdSummaryModeCreateNew;
object updateProperties = true;
return this.AutoSummarize(ref length, ref mode, ref updateProperties);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.