Aracılığıyla paylaş


Bookmark.Expand Yöntem

Genişleyen Bookmark denetim.

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

Sözdizimi

'Bildirim
Function Expand ( _
    ByRef unit As Object _
) As Integer
int Expand(
    ref Object unit
)

Parametreler

Dönüş Değeri

Tür: System.Int32
Eklenen karakter sayısı Bookmark denetim.

Notlar

İsteğe Bağlı Parametreler

İsteğe bağlı parametreler hakkında daha fazla bilgi edinmek için bkz. Office Çözümlerinde İsteğe Bağlı Parametreler.

Örnekler

Aşağıdaki kod örneği ekler bir Bookmark denetim ilk paragrafa metin ile bir cümle yer işaretinden sonra sonra ekler ve yeni bir cümle eklemek için yer işareti genişletir.

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

Private Sub BookmarkExpand()
    Dim unit As Object = Word.WdUnits.wdSentence
    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 "
    Bookmark1.InsertAfter("bookmark text. This is text inserted" _
       & " after the bookmark.")
    Bookmark1.Expand(unit)

End Sub
private void BookmarkExpand()
{
    object unit = Word.WdUnits.wdSentence;
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample ";
    bookmark1.InsertAfter("bookmark text. This is text "
                    + "inserted after the bookmark. ");
    bookmark1.Expand(ref unit); 
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Bookmark Arabirim

Microsoft.Office.Tools.Word Ad Alanı