Bookmark.FitTextWidth 属性

获取或设置 Microsoft Office Word 适合 Bookmark 控件中的文本的宽度(以当前度量单位表示)。

命名空间:  Microsoft.Office.Tools.Word
程序集:  Microsoft.Office.Tools.Word(在 Microsoft.Office.Tools.Word.dll 中)

语法

声明
Property FitTextWidth As Single
    Get
    Set
float FitTextWidth { get; set; }

属性值

类型:System.Single
Microsoft Office Word 适合 Bookmark 控件中的文本的宽度(以当前度量单位表示)。

示例

下面的代码示例向第一个段落添加一个带有文本的 Bookmark 控件,然后将 FitTextWidth 属性更改为一英寸。

此示例针对的是文档级自定义项。

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 安全性

请参见

参考

Bookmark 接口

Microsoft.Office.Tools.Word 命名空间