幽蓝 发表于 2008-2-25 22:48:00

[求助]VBA中怎么设置某个多行文字的宽度比例

如下段程序
'添加文字
Dim Mtextobj As AcadMText
Dim width As Double
Dim textString As String
Dim saveasname As String
Dim pinsert(0 To 2) As Double
pinsert(0) = 234
pinsert(1) = 27
pinsert(2) = 0
width = 10
textString = XH    '写产品型号
Set Mtextobj = acadDocs.Item(0).ModelSpace.AddMText(pinsert, width, textString)    '在模型空间中填写文字对象
Mtextobj.Height = 2
Mtextobj.???'这句应该设该文字的宽度比例(如0.7)以便填写表格,可是我不会了,特向大家求教.
谢谢

王咣生 发表于 2008-2-26 09:12:00

先建立一个TextStyle对象,设置Width属性(即宽度比例),
然后将Mtextobj.StyleName = 新建的TextStyle名称.

幽蓝 发表于 2008-2-28 21:51:00

非常感谢,我去试试,今后我也要多参加交流。
页: [1]
查看完整版本: [求助]VBA中怎么设置某个多行文字的宽度比例