Error Message

G

Guest

I've written a program that runs some procedures and then creates an email.
I use this program on many diffrenent computers, sometimes I need to use
SendforReview and other times I need to use SendMail because one or the other
causes an error depending on the mail system installed on each comp.
My question is:
Is there a way for me to write code that says
if error then
use other email method

the main thing i want to do is to have my program interupt the error message
and just automatically use the other method so the error doesn't even come
up.
Or is there a way to accomplish this before the program even knows there is
an error? I saw this in the help file:

Select Case Application.MailSystem
Case xlMAPI
MsgBox "Mail system is Microsoft Mail"
Case xlPowerTalk
MsgBox "Mail system is PowerTalk"
Case xlNoMailSystem
MsgBox "No mail system installed"
End Select

So if I knew how to create more Cases for different mail systems then I
probably make that work, but I'm not sure how to make it recognize what mail
system each comp is ususing if it is outside MAPI or PowerTalk, and I'm not
even sure what those are. Does "Microsoft Mail" mean Microsoft Outlook or
Outlook Express?

Sorry for the length of this, and than you for the help.
Jordan
 
T

Tom Ogilvy

to use the error approach you can


Sub Tester3()
On Error GoTo TrySecondMethod

FirstMethod:

'
' code for first method
'

GoTo ContinueOn

TrySecondMethod:
MsgBox "First Method Failed" & _
vbNewLine & "Trying Second Method"
Resume SecondMethod
SecondMethod:
On Error GoTo QuitNow

'
' code for second method
'

ContinueOn:
On Error Resume Next

'
' code for after either method completes
'

Exit Sub
QuitNow:
MsgBox "Error in Second Method, Failed"
End Sub

You can take out the msgbox lines used for illustration.
 

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