Bookmark.Expand(Object) Yöntem

Tanım

Denetimi genişletir Bookmark .

public int Expand (ref object unit);

Parametreler

unit
Object

Denetimin aralığının genişletilme birimi Bookmark . Microsoft.Office.Interop.Word.WdUnits.

Döndürülenler

Int32

Denetime eklenen karakterlerin sayısı Bookmark .

Örnekler

Aşağıdaki kod örneği, Bookmark ilk paragrafa metin içeren bir denetim ekler, sonra yer işaretinden sonra bir tümce ekler ve yer işaretini yeni tümceyi içerecek şekilde genişletir.

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

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);	
}
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

Açıklamalar

İsteğe Bağlı Parametreler

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

Şunlara uygulanır