恭喜,你发布的帖子
发布于 2024-08-09 19:22:19
1楼
Dim obj As HMICircle
Dim objVBScript As HMIScriptInfo
' 尝试使用错误处理来捕获并显示错误信息
On Error Resume Next
Set obj = ActiveDocument.HMIObjects("圆3")
If Not obj Is Nothing Then
Set objVBScript = obj.Radius.CreateDynamic(hmiDynamicCreationTypeVBScript)
If Not objVBScript Is Nothing Then
With objVBScript
' .SetTriggerType hmiTriggerTypeAnimationCycle
.Trigger.Name = "VBA_StandardCycle"
' .sourceCode = "" '
End With
Else
MsgBox "CreateDynamic failed for the radius of the HMICircle object."
End If
Else
MsgBox "HMICircle object '圆3' not found."
End If
' 如果发生错误,则显示错误信息
If Err.Number <> 0 Then
MsgBox "Error " & Err.Number & ": " & Err.Description
Err.Clear
On Error GoTo 0 '
请填写推广理由:
分享
只看
楼主