标题: 请大家帮忙修改下错误,急! [打印本页] 作者: sherry1860 时间: 2006-6-26 21:10 标题: 请大家帮忙修改下错误,急! 小第在做二次开发中遇到了如下问题,在运行VB程序时,老是出现“变量未定义”这错误,具体指出为以下句子的红色部分请高手门指点下,应该如何修改。粘贴的可能太多,请原谅~
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
If Dir(App.Path & "\公差零件.SLDDRW") = "" Then
Call MsgBox("此文件不存在!", vbExclamation)
Exit Sub
End If
'使用默认程序打开文件
Call ShellExecute(hwnd, "Open", App.Path & "\公差零件.SLDDRW", "", App.Path, 1)
Set DatumTag = Part.InsertDatumTag2()
If Not DatumTag Is Nothing Then
DatumTag.FilledTriangle = 1
DatumTag.Shoulder = 0
Set Annotation = DatumTag.GetAnnotation()
If Not Annotation Is Nothing Then
boolstatus = Annotation.SetPosition(1.067232377125, 0.6552597614075, -3.550623543045E-15)
End If
End If
Dim Note As Object
Dim TextFormat As Object
Set Note = Part.InsertNote("<FONT name=""仿宋_GB2312"" size=20PTS><FONT color=D><FONT name=""Century Gothic"" size=3.5 style=RB effect=RU><FONT style=RI effect=RS>其余")
If Not Note Is Nothing Then
Note.Angle = 0
boolstatus = Note.SetBalloon(0, 0)
Set Annotation = Note.GetAnnotation()
If Not Annotation Is Nothing Then
longstatus = Annotation.SetLeader2(False, 0, True, False, False, False)
boolstatus = Annotation.SetPosition(0.2690534456254, 0.8237577458876, 0)