Aracılığıyla paylaş


Bookmark.ComputeStatistics Yöntem

İçeriğini temel alarak bir istatistik alır Bookmark denetim.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word (Microsoft.Office.Tools.Word.dll içinde)

Sözdizimi

'Bildirim
Function ComputeStatistics ( _
    Statistic As WdStatistic _
) As Integer
int ComputeStatistics(
    WdStatistic Statistic
)

Parametreler

Dönüş Değeri

Tür: System.Int32
İçeriğini temel alarak bir istatistik Bookmark denetim.

Örnekler

Aşağıdaki kod örneği ekler bir Bookmark metin denetimi ve karakterlerin toplamı görüntüler yer işaretinin kullanılmasıyla ComputeStatistics yöntemi.

Bu örnek, belge düzeyinde özelleştirme içindir

Private Sub BookmarkComputeStatistics()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    Bookmark1.Text = "This is sample bookmark text."

    Dim totalCharacters As Integer = Bookmark1.ComputeStatistics( _
        Word.WdStatistic.wdStatisticCharacters)
    MessageBox.Show("The bookmark contains " & _
        totalCharacters.ToString() & " characters.")

End Sub
private void BookmarkComputeStatistics()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";
    int totalCharacters = bookmark1.ComputeStatistics(Word
        .WdStatistic.wdStatisticCharacters);
    MessageBox.Show("The bookmark contains " + 
        totalCharacters.ToString() + " characters.");
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Bookmark Arabirim

Microsoft.Office.Tools.Word Ad Alanı