有关在VBA中输入中文的问题!!!!
在VBA中我输入中文后,在CAD中显示的是???(问号),请问该怎样在VBA中输入中文,使得自动生成的CAD图形中显示中文。 天哪!你没有进行字型字体设置吧? 怎样进行字体、字型的设置阿??????我看了帮助不明白阿!!!!! 用以下代码试试:Sub Textstyle()<BR> Dim Txtstyle As AcadTextStyle<BR> Dim Text As AcadText<BR> Dim Txt(2) As Double<BR> Set Txtstyle = ThisDrawing.TextStyles.Add("ºÚÌå")<BR> ThisDrawing.ActiveTextStyle = Txtstyle<BR> Txtstyle.fontFile = "c:\windows\fonts\simhei.ttf"<BR> Txtstyle.Width = 1.2<BR> Txt(0) = 0: Txt(1) = 0: Txt(2) = 0<BR> '在 (0 0 0) 处写入"明经通道示例";高度为5,宽度比为1:1.2<BR> Set Text = ThisDrawing.ModelSpace.AddText("Ã明经通道示例", Txt, 5)<BR>End Sub 用以下代码试试:
Sub Textstyle()<BR> Dim Txtstyle As AcadTextStyle<BR> Dim Text As AcadText<BR> Dim Txt(2) As Double<BR> Set Txtstyle = ThisDrawing.TextStyles.Add("黑体")<BR> ThisDrawing.ActiveTextStyle = Txtstyle<BR> Txtstyle.fontFile = "c:\windows\fonts\simhei.ttf"<BR> Txtstyle.Width = 1.2<BR> Txt(0) = 0: Txt(1) = 0: Txt(2) = 0<BR> '在 (0 0 0) 处写入"明经通道示例";高度为5,宽度比为1:1.2<BR> Set Text = ThisDrawing.ModelSpace.AddText("明经通道示例", Txt, 5)<BR>End Sub
对不起!在发贴子时,汉字未能正常显示,再发一次 谢谢兄弟,搞定!!!!!!!
页:
[1]