【发布时间】:2017-04-02 21:12:53
【问题描述】:
我想更改字体并将其样式设置为粗体。 我有两个问题:
- 更改
CharWeight有效,但无效CharFontName - 它将“粗体”应用于整个段落,而不仅仅是选定内容
这是我的代码:
sub AddAnimation
xTextCursor = ThisComponent.CurrentController.Selection(0)
xText = xTextCursor.getText()
xText.CharFontName = "Consolas"
xText.CharWeight = com.sun.star.awt.FontWeight.BOLD
end Sub
【问题讨论】:
-
当前设置的字体名称是什么?尝试从一个空文档开始并创建一个文本块。
标签: openoffice-impress libreoffice-impress libreoffice-macros