Bookmark.FitTextWidth Eigenschaft

Definition

Ruft die Breite (in der aktuellen Maßeinheit) ab, an die Microsoft Office Word den Text des Bookmark-Steuerelements anpasst, oder legt die Breite fest.

public float FitTextWidth { get; set; }

Eigenschaftswert

Single

Die Breite (in der aktuellen Maßeinheit), an die Microsoft Office Word den Text des Bookmark-Steuerelements anpasst.

Beispiele

Im folgenden Codebeispiel wird ein Bookmark -Steuerelement mit Text zum ersten Absatz hinzugefügt, und anschließend wird die FitTextWidth -Eigenschaft auf einen Zoll geändert.

Dieses Beispiel gilt für eine Anpassung auf Dokument Ebene.

private void BookmarkFitTextWidth()
{
    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.FitTextWidth = Application.InchesToPoints(1);
}
Private Sub BookmarkFitTextWidth()

    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.FitTextWidth = Application.InchesToPoints(1)

End Sub

Gilt für