?? vba11-6.txt
字號:
Public Sub UseGetStringDialog()
Dim pGetStringDialog As IGetStringDialog
Dim pMessageDialog As IMessageDialog
Dim blnOK As Boolean
Dim blnYes As Boolean
Dim strName As String
' Initiate the variables and objects
strName = "Bob"
blnYes = False
Set pGetStringDialog = New GetStringDialog
Set pMessageDialog = New MessageDialog
' Place the process in a loop so that
' it can be repeated.
Do While Not blnYes
' Display the Get String Dialog.
blnOK = pGetStringDialog.DoModal( _
"Get String Dialog Example", "Name:", strName, 0)
If blnOK Then
' Get the name that user provided.
strName = pGetStringDialog.Value
' Display the Message Dialog.
blnYes = pMessageDialog.DoModal( _
"Message Dialog Example", _
"Is your name " & strName & "?", _
"Yes", "No", 0)
Else
' User selected the Cancel button,
' end the macro.
Exit Do
End If
Loop
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -