2,462
社区成员
发帖
与我相关
我的任务
分享
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