自己遇到这个问题,费了不少力气解决的,现在把代码贴出来,希望能对后来者有点帮助。期间zw的客服还是给过一点帮助的,但是也许是问题有点烦或者更可能是我太烦,客服的小妹妹不理我了。本想投诉,后来一想古人云“行有不得,反求诸己”,就放下了。偶然开窍,找到了解决的方法。
Public Sub font()
Dim textObj As ZwcadText
Dim TS As ZwcadTextStyle
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim height As Double
Set TS = ThisDocument.TextStyles.Add("我的文字样式") '定义新的文字样式
TS.FontFile = "宋体" '制定定义样式字体
ThisDocument.ActiveTextStyle = TS '激活样式
' Define the text object
textString = "我的文字再来一次"
insertionPoint(0) = 10: insertionPoint(1) = 80: insertionPoint(2) = 0
height = 10
' Create the text object in model space
Set textObj = ThisDocument.ModelSpace.AddText(textString, insertionPoint, height)
textObj.Color = zcRed
textObj.StyleName = "我的文字样式"
textObj.Update
ThisDocument.Regen
End Sub
Public Sub font()
Dim textObj As ZwcadText
Dim TS As ZwcadTextStyle
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim height As Double
Set TS = ThisDocument.TextStyles.Add("我的文字样式") '定义新的文字样式
TS.FontFile = "宋体" '制定定义样式字体
ThisDocument.ActiveTextStyle = TS '激活样式
' Define the text object
textString = "我的文字再来一次"
insertionPoint(0) = 10: insertionPoint(1) = 80: insertionPoint(2) = 0
height = 10
' Create the text object in model space
Set textObj = ThisDocument.ModelSpace.AddText(textString, insertionPoint, height)
textObj.Color = zcRed
textObj.StyleName = "我的文字样式"
textObj.Update
ThisDocument.Regen
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货