Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAPI issue different to Outlook Express than Outlook

Status
Not open for further replies.

ktechit

IS-IT--Management
May 7, 2003
14
US
Have to resolve or come up with a work-around for some of our users. Our application has a button "Send Email" that works fine if the user's default mail client is Outlook Express, Eudora, or other simple email clients. It simply opens a new email window, like normal.

If Outlook 2000 -- 2003 is the default mail client, we get this error :
"OLE IDispatch exception code 0 from MAPImessages: Unspecified Failure has occurred. "

Our code for the "Send Email" feature is below:
************************
#DEFINE ERR_NOMAPI_LOC "It does not appear that you have MAPI installed. Mail could not be run."

thisform.logsession = .T.

IF !FILE(GETENV("WINDIR")+"\SYSTEM32\MAPI32.DLL");
AND !FILE(GETENV("WINDIR")+"\SYSTEM\MAPI32.DLL")
MESSAGEBOX(ERR_NOMAPI_LOC)
thisform.logsession = .f.
RETURN .F.
ENDIF

thisform.OLEMSess.signon
***********************************

now, we see that Outlook 2003 on one of our test computers pulls up mapi32.dll from:

C:\Program Files\Common Files\System\MSMAPI\1033\mapi32.dll

? So, is the only option to re-code for that location, or is there a statement that will be more general, to look in \system32 or \1033 for the correct mapi32.dll for the default mail client ?

didn't want to re-code and send out to all users, but will if necessary.

thanks for any help,

ktechit
 
I'm not sure I understand why you need to know the exact path to the mapi32.dll. Can't you just check if you can create a mapi object? Something like...
Code:
IF TYPE([CREATEOBJECT("MSMAPI32.MAPISession")]) = "O"
  ? "MAPI Installed... proceed to email"
ELSE
  ? "MAPI Not Installed... proceed to inform user"
ENDIF


boyd.gif

SweetPotato Software Website
My Blog
 
thanks for the suggestion. I've sent it on to the programmer for this software, will find out what he thinks on making a change like this, then rolling out to the clients. May have to wait until next version rollout for it if he has to make other changes also.

thanks again,

ktechit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top