WPS 基础接口 > 文字 API 参考 > Font > 属性 > Font.Spacing 属性
返回或设置字符的间距(以磅为单位)。可读写 Single 类型。

语法

表达式.Spacing

表达式   必选。一个代表 Font 对象的变量。

示例

以下示例演示活动文档开头的两种不同字符间距。

示例代码
let myRange = ActiveDocument.Range(0, 0)
    myRange.InsertAfter("Demonstration of no character spacing.")
    myRange.InsertParagraphAfter()
    myRange.InsertAfter("Demonstration of character spacing (1.5pt).")
    myRange.InsertParagraphAfter()

ActiveDocument.Paragraphs.Item(2).Range.Font.Spacing = 1.5

以下示例将所选文本的字符间距设置为 2 磅。

示例代码
if(Selection.Type == wdSelectionNormal){
    Selection.Font.Spacing = 2
}
else{
    MsgBox("You need to select some text.")
}


请参阅