Hi All
I have written code which will send mails. Unfortunately for some rows mail address will not be in correct format, for those email, outlook will throw some error like "Outlook doesn't recognize one or more names" and macro will stops running.
Is there any way to highlight that rows and continue macro for next rows.
Here is the code i have used
I have written code which will send mails. Unfortunately for some rows mail address will not be in correct format, for those email, outlook will throw some error like "Outlook doesn't recognize one or more names" and macro will stops running.
Is there any way to highlight that rows and continue macro for next rows.
Here is the code i have used
Code:
For Each olMail In Fldr.Items
Set objmail = olApp.CreateItem(olMailItem)
objmail.To = "MAIL ADDRESS"
With objmail
.Subject = "SUBJECT"
.htmlBody = "Hello" & " " & "<br><br>" & "MESSAGE"
.Display
End With
Exit For
Next