error handling

D

daren white

I want to send a form by email with the following code. It works fine unless
the user is in someone elses email account with no send rights. I want it to
show an error. Is it possible to have sendforreview produce an error?

ChangeFileOpenDirectory "O:\NEWMATTERS\"
Dim FName As String
Dim Dte As String
On Error GoTo errmsg
Dte = Format$(Now, "ddmmyyhhmmss")
FName = UserForm2.ComboBox5
ActiveDocument.SaveAs FileName:=FName & Dte & ".doc"
On Error GoTo errmsg
ActiveDocument.SendForReview "Accounts", "New Matter", True, False
MsgBox "Email Sent"
Application.Run MacroName:="unloadforms"
Exit Sub
errmsg:
MsgBox "Email not sent - please check you are logged into your own groupwise
account", vbCritical
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top