Share via


DocumentBase.ComputeStatistics 메서드

문서의 내용을 기반으로 한 통계를 가져옵니다.

네임스페이스:  Microsoft.Office.Tools.Word
어셈블리:  Microsoft.Office.Tools.Word.v4.0.Utilities(Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

구문

‘선언
Public Function ComputeStatistics ( _
    statistic As WdStatistic, _
    ByRef includeFootnotesAndEndnotes As Object _
) As Integer
public int ComputeStatistics(
    WdStatistic statistic,
    ref Object includeFootnotesAndEndnotes
)

매개 변수

  • includeFootnotesAndEndnotes
    형식: System.Object%
    통계를 계산할 때 각주와 미주를 포함시키려면 true를 지정합니다.기본값은 false입니다.

반환 값

형식: System.Int32
Statistic 매개 변수에서 지정하는 형식의 항목 수입니다.

설명

선택적 매개 변수

선택적 매개 변수에 대한 자세한 내용은 Office 솔루션의 선택적 매개 변수를 참조하십시오.

예제

다음 코드 예제에서는 ComputeStatistics 메서드를 사용하여 각주와 미주를 제외한 문서의 단어 수를 표시합니다. 이 예제를 사용하려면 문서 수준 프로젝트 ThisDocument 클래스에서 실행하십시오.

Private Sub DocumentComputeStatistics()
    Dim wordCount As Integer = Me.ComputeStatistics( _
        Word.WdStatistic.wdStatisticWords, False)
    MessageBox.Show(("There are " + wordCount.ToString() + _
        " words in this document."))
End Sub
private void DocumentComputeStatistics()
{
    object IncludeFootnotesAndEndnotes = false;

    int wordCount = this.ComputeStatistics(
        Word.WdStatistic.wdStatisticWords,
        ref IncludeFootnotesAndEndnotes);
    MessageBox.Show("There are " + wordCount.ToString() +
        " words in this document.");
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

DocumentBase 클래스

Microsoft.Office.Tools.Word 네임스페이스