154965 发表于 2018-8-12 17:04:32

coreldrawVBA无法修改字体为指定英文字体,求指教

自己写的,但是不知道问题出在哪里,修改的字体名称为中文时可用,但是无法更改为英文字体。尝试过“方正黑体简体”“黑体”“微软雅黑”“经典宋体简”等等字体都可以顺利修改,但是字体名为英文时,如“arial black”“times new roman”等等会直接改为arial字体,不知道问题出在哪里,还请路过的高手指点迷津。
代码如下
Sub zi()
ActiveDocument.Unit = cdrMillimeter
Dim s As Shape
Set s = ActiveDocument.Selection.Shapes(1)
If s.Type = cdrTextShape Then
s.Text.FontProperties.Name = "times new roman"
End If
Set OrigSelection = ActiveSelectionRange
ActiveDocument.ReferencePoint = cdrMiddleLeft
OrigSelection.SizeWidth = 15
End Sub


?123 发表于 2018-8-12 18:21:32

Sub zi()
ActiveDocument.Unit = cdrMillimeter
Dim s As Shape
Set s = ActiveDocument.Selection.Shapes(1)
If s.Type = cdrTextShape Then
s.Text.Story.Font = "Gabriola"
'FontProperties.Name = "times new roman"
End If
Set OrigSelection = ActiveSelectionRange
ActiveDocument.ReferencePoint = cdrMiddleLeft
OrigSelection.SizeWidth = 15
End Sub
试试这个,我跑了一次,没发现问题。吃饭了,闪人了……
页: [1]
查看完整版本: coreldrawVBA无法修改字体为指定英文字体,求指教