Public Sub ShowStep1()
cmdNext.Caption = "&Next >"
cmdBack.Enabled = True
lblReg.Caption = "Step 1 - Request Registration Key"
[HL="#FFFF80"]' lblExplain.Caption = "Pressing Next will generate an " _
' & "E-mail requesting a Registration Key. When you receive " _
' & "that key via return E-mail, you can finish the " _
' & "registration process by completing the " & optRegStep(1).Caption _
' & " step, (Step 2)."
lblExplain.Caption = "Press Next and then send me an " _
& "E-mail as you will be instructed to. When you receive " _
& "that key via return E-mail, you can finish the " _
& "registration process by completing the " & optRegStep[/HL](1).Caption _
& " step, (Step 2)."
optRegStep(0).Visible = False
optRegStep(1).Visible = False
lblName.Visible = True
txtName.Visible = True
[HL="#FFFF80"] 'new
txtName.Text = "Press Next"
txtName.Enabled = False[/HL]
lblRegKey.Visible = False
lblRegisterTo.Visible = False
txtRegisterTo.Visible = False
txtRegKey(0).Visible = False
txtRegKey(1).Visible = False
txtRegKey(2).Visible = False
lblDash1.Visible = False
lblDash2.Visible = False
[HL="#FFFF80"]' txtName.SetFocus[/HL]
End Sub
Public Function RequestKey() As Boolean
' Dim strCriteria As String
Dim mpSession As MAPISession
Dim mpMessages As MAPIMessages
On Error GoTo ErrorRoutine
' This causes this validation (for step 1) to
' be bypassed when going directly to step 2
If txtName.Visible = False Then
RequestKey = True
Exit Function
End If
If Trim(txtName) = "" Then
MsgBox "Please enter your name.", _
vbExclamation, REG_ERR_TITLE
txtName.SetFocus
m_StepCompleted = m_StepCompleted - 1
Exit Function
End If
Screen.MousePointer = vbHourglass
Me.Hide
[HL="#FFFF80"]' frmWait.Show
'
' gRegClass.Subject = StrConv(LCase(App.EXEName), vbProperCase) & " Registration Request"
'
' Set mpSession = MAPISession1
' Set mpMessages = MAPIMessages1
'
' mpSession.DownLoadMail = False
' 'show the logon interface for the mail
' mpSession.LogonUI = True
' 'sign on to selected account
' mpSession.SignOn
'
' DoEvents
'
' 'check if logon was successful
' If mpSession.SessionID = 0 Then
' 'SendMAPIMail = False
' MsgBox "Error On login To MAPI", _
' vbCritical, "MAPI"
' Exit Function
' End If
'
' 'set the session IDs the same on both objects
' mpMessages.SessionID = mpSession.SessionID
'
' 'Set the MSgIndex to -1, this needs to be
' 'done for the Compose event to work
' mpMessages.MsgIndex = -1
' 'compose a new message
' mpMessages.Compose
'
' 'don't show the resolve address interface
' mpMessages.AddressResolveUI = False
'
' 'set the recipient
' mpMessages.RecipIndex = 0
' mpMessages.RecipType = mapToList
' mpMessages.RecipAddress = EMAIL
' 'resolve the recipient's email addresses
' mpMessages.ResolveName
'
' 'set the subject
' mpMessages.MsgSubject = gRegClass.Subject
'
' 'set the Message/Body/NoteText
' mpMessages.MsgNoteText = txtName & " " & GetSerialNumber
'
' 'send the message
' mpMessages.Send
'
' 'close the current session
' mpSession.SignOff
'
' 'clear objects
' Set mpMessages = Nothing
' Set mpSession = Nothing
'new
MsgBox "Send me an email which includes your name and this number." _
& vbCrLf & vbCrLf & GetSerialNumber[/HL]
Screen.MousePointer = vbNormal
Unload Me
DoEvents
RequestKey = True
Unload frmWait
Exit Function
ErrorRoutine:
Set mpMessages = Nothing
Set mpSession = Nothing
Screen.MousePointer = vbNormal
frmRegError.Show vbModal
m_StepCompleted = m_StepCompleted - 1
RequestKey = False
Err.Clear
End Function