- Joined
- Dec 13, 2017
- Messages
- 71
- Reaction score
- 19
Currently the code below asks a simple Yes/No question.
The code runs if there is a deletion anywhere on the worksheet. I am try to ask the user if they are deleting Pending. If they answer "Yes" then the posted code runs, If "No", the entry is deleted& that is the end.
Currently the only line I can get to run is
Is what I am asking possible? If it is could you point me in the proper direction.
Code:
'Pending delete.
Application.Speech.Speak "Two appointments were scheduled on your calendar previously. One for a Contact Letter, one to Cancel the Consult ", SpeakAsync:=True
Application.Wait (Now + TimeValue("00:00:2"))
Ans = MsgBox("Two appointments were scheduled on your calendar previously. One for a Contact Letter, one to Cancel the Consult " & vbCrLf & vbNewLine & "Click Yes to delete the future appointments,if veteran contacted you. Click No, if there was no contact from the veteran.", vbYesNo + vbInformation, _
"Vocational Services Reminder")
Select Case Ans
Case vbYes
'[code if Ans is Yes]...
'Opens Outlook appointment Calendar.
Dim olApp2 As Object ' Outlook.Application
MsgBox " If canceling, because the veteran replied. Choose an entry from the list, or enter a different one, in the Reason Column.", vbInformation, "Vocational Services Database - " & ActiveSheet.Name
Set olApp2 = CreateObject("Outlook.Application")
olApp2.Session.GetDefaultFolder(olFolderCalendar).Display
Application.EnableEvents = False
Range("$M$3:$M$329").ClearContents
Application.EnableEvents = True
ActiveCell.Offset(0, -1).Select
End Select
Select Case Ans
Case vbNo
' ...[code if Ans is No]...
MsgBox " Enter the reason in the Column. You can choose from the drop down list or enter a new one.", vbInformation, "Vocational Services Database - " & ActiveSheet.Name
ActiveCell.Offset(0, -1).Select
End Select
Exit Sub
Currently the only line I can get to run is
'Ans = MsgBox("Are you deleting pending?", vbYesNo + vbInformation, _
"Vocational Services Reminder")
Is what I am asking possible? If it is could you point me in the proper direction.