Tejas Kore
Board Regular
- Joined
- Nov 2, 2017
- Messages
- 72
- Office Version
- 365
- Platform
- Windows
Hi All,
I am trying to automate mail sending process. Now, the code which I have is working fine. But I want to add more functionality to it.
After ML.Display in the below code snippet, I want to hold on the flow of execution. ML.Display will display the mail which is ready. After that I want to add the functionality which is I should be able to send the mail by clicking on send mail button if i want and if I don't then I will close the mail template. Right now I am achieving the same functionality by using message box.
As soon as I take the action i.e. either I send the mail or I close the ready template then the flow which was hold off should resume execution.
.
. ML.To = Madd ' address
ML.CC = MaddCC 'CC
ML.Subject = "Testing"
ML.Display
answer = MsgBox("To continue select YES", vbYesNo)
If answer = vbYes Then
On Error GoTo ErrCatcher
ML.Send 'sending
Else
Mws.Cells(j, 9).Value = "Not Send"
End If
On Error GoTo 0
ErrCatcher:
If Err <> 0 Then Mws.Cells(j, 8).Value = "Name Resolution Failed"
'Else
' Mws.Cells(j, 9).Value = "Not Send"
'End If
j = j + 1
.
.
.
Any suggestions/solutions are welcome.
I am trying to automate mail sending process. Now, the code which I have is working fine. But I want to add more functionality to it.
After ML.Display in the below code snippet, I want to hold on the flow of execution. ML.Display will display the mail which is ready. After that I want to add the functionality which is I should be able to send the mail by clicking on send mail button if i want and if I don't then I will close the mail template. Right now I am achieving the same functionality by using message box.
As soon as I take the action i.e. either I send the mail or I close the ready template then the flow which was hold off should resume execution.
.
. ML.To = Madd ' address
ML.CC = MaddCC 'CC
ML.Subject = "Testing"
ML.Display
answer = MsgBox("To continue select YES", vbYesNo)
If answer = vbYes Then
On Error GoTo ErrCatcher
ML.Send 'sending
Else
Mws.Cells(j, 9).Value = "Not Send"
End If
On Error GoTo 0
ErrCatcher:
If Err <> 0 Then Mws.Cells(j, 8).Value = "Name Resolution Failed"
'Else
' Mws.Cells(j, 9).Value = "Not Send"
'End If
j = j + 1
.
.
.
Any suggestions/solutions are welcome.