Bookmark.TextRetrievalMode Özellik

Tanım

TextRetrievalModeMetnin denetimden nasıl alındığını denetleyen bir nesne alır veya ayarlar Bookmark .

public Microsoft.Office.Interop.Word.TextRetrievalMode TextRetrievalMode { get; set; }

Özellik Değeri

TextRetrievalMode

TextRetrievalModeDenetimden metnin nasıl alındığını denetleyen nesne Bookmark .

Örnekler

Aşağıdaki kod örneği, Bookmark belgeye metin içeren bir denetim ekler, yer işaretindeki üçüncü sözcüğü gizler ve TextRetrievalMode gizli metnin dahil olmadığı şekilde ayarlar. Sonra, yer işaretinin metnini bir ileti kutusunda görüntüler.

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

private void BookmarkTextRetrievalMode()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    int WordTrue = 1;
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";
    bookmark1.Words[3].Font.Hidden = WordTrue;
    bookmark1.TextRetrievalMode.IncludeHiddenText = false;
    MessageBox.Show("The text in bookmark1 is: " + bookmark1.Text);
}
Private Sub BookmarkTextRetrievalMode()

    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."
    Bookmark1.Words(3).Font.Hidden = True
    Bookmark1.TextRetrievalMode.IncludeHiddenText = False
    MessageBox.Show("The text in Bookmark1 is: " & Bookmark1.Text)

End Sub

Şunlara uygulanır