如果将字体或范围设置为倾斜格式,则该属性值为
True。
Long 类型,可读写。
语法
表达式.Italic
表达式 一个代表 Font
对象的变量。
说明
该属性返回 True、False 或 wdUndefined(当返回值既可为 True,也可为 False 时取该值)。可设置为
True、False 或 wdToggle。
示例
以下示例检查所选内容中的倾斜格式并删除所选内容中存在的倾斜格式。
示例代码 |
if(Selection.Type == wdSelectionNormal){
let mySel = Selection.Font.Italic
if(mySel == wdUndefined || mySel == true){
MsgBox("there is italic text in selection. " + "Click OK to remove.")
Selection.Font.Italic = false
}
else{
MsgBox("No italic text in the selection.")
}
}
else{
MsgBox("You need to select some text.")
}
|