Bookmark.InStory أسلوب
تحديد ما إذا كان Bookmarkعنصر تحكم التي يطبق عليها هذا الأسلوب هو في القصة نفسها كنطاق محدد Rangeوسيطة.
مساحة الاسم: Microsoft.Office.Tools.Word
التجميع: Microsoft.Office.Tools.Word (في Microsoft.Office.Tools.Word.dll)
بناء الجملة
'إقرار
Function InStory ( _
Range As Range _
) As Boolean
bool InStory(
Range Range
)
المعلمات
- Range
النوع: Microsoft.Office.Interop.Word.Range
Rangeكائن له قصة هو مقارنة بالقصة التي تحتوي على Bookmarkعنصر التحكم.
القيمة المُرجعة
النوع: System.Boolean
trueإذاBookmarkعنصر تحكم التي يطبق عليها هذا الأسلوب هو في القصة نفسها كنطاق محددRangeوسيطة؛ وإلاfalse.
أمثلة
مثال التعليمة البرمجية التالية يضيف Bookmarkالتحكم بالنص إلى مستند، ثم التحقق لمعرفة ما إذا كان يتم في القصة نفسها أول فقرة. ثم يتم عرض نتائج في صندوق رسالة.
Th هو المثال هو لتخصيص المستوى مستند.
Private Sub BookmarkInStory()
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."
If Bookmark1.InStory(Me.Paragraphs(1).Range) Then
MessageBox.Show("The bookmark is in the same story as " _
& "the first paragraph.")
Else
MessageBox.Show("The bookmark is not in the same story " _
& "as the first paragraph.")
End If
End Sub
private void BookmarkInStory()
{
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.";
if (bookmark1.InStory(this.Paragraphs[1].Range))
{
MessageBox.Show("The bookmark is in the same story as "+
"the first paragraph.");
}
else
{
MessageBox.Show("The bookmark is not in the same story " +
"as the first paragraph.");
}
}
أمن NET Framework.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.