Freigeben über


Bookmark.CharacterWidth-Eigenschaft

Ruft die Zeichenbreite des Texts im Bookmark-Steuerelement ab oder legt diese fest.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

'Declaration
Property CharacterWidth As WdCharacterWidth
WdCharacterWidth CharacterWidth { get; set; }

Eigenschaftswert

Typ: Microsoft.Office.Interop.Word.WdCharacterWidth
Einer der WdCharacterWidth-Werte.

Beispiele

Im folgenden Codebeispiel wird ein Bookmark-Steuerelement mit Text hinzugefügt. Anschließend wird die Zeichenbreite des Texts auf die halbe Breite festgelegt.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

Private Sub BookmarkCharacterWidth()

    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.CharacterWidth = Word.WdCharacterWidth.wdWidthHalfWidth

End Sub
private void BookmarkCharacterWidth()
{
    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.";
    bookmark1.CharacterWidth = Word.WdCharacterWidth
        .wdWidthHalfWidth;
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Bookmark Schnittstelle

Microsoft.Office.Tools.Word-Namespace