1.- Sub Example_GetInt()
-
- On Error Resume Next
-
- ThisDrawing.Utility.InitializeUserInput 128
-
- Dim returnInt As Integer
- returnInt = ThisDrawing.Utility.GetInteger(vbCr & "请输入数值<10>: ")
- If Err Then
- If StrComp(Err.Number, -2145320928, 1) = 0 Then
- Dim inputString As String
- Err.Clear
- inputString = ThisDrawing.Utility.GetInput
- If inputString = "" Then
- MsgBox "你输入的是默认值10", , "明经通道VBA示例"
- returnInt = 10
- Else
- MsgBox "你输入了关键字为: " & inputString
- End If
- Else
- MsgBox "出错了: " & Err.Description
- Err.Clear
- End If
- Else
- MsgBox "输入的整数为: " & returnInt, , "明经通道VBA示例"
- End If
-
- End Sub
|