مشاركة عبر


Bookmark.ComputeStatistics أسلوب

الحصول إحصاء استناداً إلى المحتويات Bookmarkعنصر تحكم.

مساحة الاسم:  Microsoft.Office.Tools.Word
التجميع:  Microsoft.Office.Tools.Word (في Microsoft.Office.Tools.Word.dll)

بناء الجملة

'إقرار
Function ComputeStatistics ( _
    Statistic As WdStatistic _
) As Integer
int ComputeStatistics(
    WdStatistic Statistic
)

المعلمات

القيمة المُرجعة

النوع: System.Int32
إحصاء استناداً إلى المحتويات Bookmarkعنصر التحكم.

أمثلة

ما يلي تعليمات برمجية في المثال إضافة Bookmarkالتحكم بالنص ثم يعرض العدد الإجمالي للأحرف باستخدام إشارة مرجعية ComputeStatisticsالأسلوب.

Th هو المثال هو لتخصيص المستوى مستند.

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.

راجع أيضًَا

المرجع

Bookmark واجهة

Bookmark الأعضاء

Microsoft.Office.Tools.Word مساحة الاسم