Bookmark.FitTextWidth-Eigenschaft
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.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
Syntax
'Declaration
Property FitTextWidth As Single
Get
Set
float FitTextWidth { get; set; }
Eigenschaftswert
Typ: System.Single
Die Breite (in der aktuellen Maßeinheit), an die Microsoft Office Word den Text des Bookmark-Steuerelements anpasst.
Beispiele
Im folgenden Codebeispiel wird dem ersten Absatz ein Bookmark-Steuerelement mit Text hinzugefügt und anschließend die FitTextWidth-Eigenschaft auf ein Zoll geändert.
Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.
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
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);
}
.NET Framework-Sicherheit
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter Verwenden von Bibliotheken aus teilweise vertrauenswürdigem Code.