Bookmark.InStory(Range) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
BookmarkBu yöntemin uygulandığı denetimin bağımsız değişken tarafından belirtilen aralıkla aynı hikaye içinde olup olmadığını belirler Range .
public bool InStory (Microsoft.Office.Interop.Word.Range Range);
Parametreler
Döndürülenler
trueBookmarkBu yöntemin uygulandığı denetim bağımsız değişken tarafından belirtilen aralıkla aynı hikayede ise Range , aksi durumda false .
Örnekler
Aşağıdaki kod örneği, Bookmark belgeye metin içeren bir denetim ekler ve ardından ilk paragrafla aynı hikayede olup olmadığını denetler. Sonuçlar daha sonra bir ileti kutusunda görüntülenir.
Bu örnek, belge düzeyinde özelleştirme içindir
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.");
}
}
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