Tejas Kore
Board Regular
- Joined
- Nov 2, 2017
- Messages
- 72
- Office Version
- 365
- Platform
- Windows
Hi All,
I am trying to automate a mail sending process. I want to catch a particular error that is when someone's name in 'To' or 'CC' field is not resolved.
Below is the code snippet -
.
.
answer = MsgBox("To continue select YES", vbYesNo)
If answer = vbYes Then
On Error GoTo ErrCatcher
ML.Send 'sending
'Exit Sub
ErrCatcher:
MsgBox "Resuming Execution"
Else
Mws.Cells(j, 9).Value = "Not Send"
End If
.
.
Here I am trying to display user the mail template for mail which is about to go. So when user is ready then he/she can select 'Yes' or 'No' through the message box. If the user selects 'Yes' then 'ML.send' gets executed and here I want to catch the error for name resolution if it occurs.
Right now this 'ErrCatcher:' will be executed in any case i.e. whether error occurs or not.
My focus is to catch error for name resolution and handle it appropriately. Any suggestions/solutions are welcome.
I am trying to automate a mail sending process. I want to catch a particular error that is when someone's name in 'To' or 'CC' field is not resolved.
Below is the code snippet -
.
.
answer = MsgBox("To continue select YES", vbYesNo)
If answer = vbYes Then
On Error GoTo ErrCatcher
ML.Send 'sending
'Exit Sub
ErrCatcher:
MsgBox "Resuming Execution"
Else
Mws.Cells(j, 9).Value = "Not Send"
End If
.
.
Here I am trying to display user the mail template for mail which is about to go. So when user is ready then he/she can select 'Yes' or 'No' through the message box. If the user selects 'Yes' then 'ML.send' gets executed and here I want to catch the error for name resolution if it occurs.
Right now this 'ErrCatcher:' will be executed in any case i.e. whether error occurs or not.
My focus is to catch error for name resolution and handle it appropriately. Any suggestions/solutions are welcome.