[AccessD] Declare function question

Carolyn Johnson cjlabs at worldnet.att.net
Wed Oct 21 11:28:23 CDT 2009


I have code to send an email via Outlook Express.   It uses the following function.

Declare Function MAPISendMail _
    Lib "c:\program files\outlook express\msoe.dll" Alias _
    "MAPISendEmailOE" ( _
    ByVal Session As Long, _
    ByVal UIParam As Long, _
    message As MAPIMessage, _
    ByVal Flags As Long, _
    ByVal Reserved As Long) As Long


Since Outlook Express is not part of Vista, I need to also have a similar function for Windows Mail with the corresponding dll:

Declare Function MAPISendMail _
    Lib "c:\Windows\System\mapi32.dll" ( _
    ByVal Session As Long, _
    ByVal UIParam As Long, _
    message As MAPIMessage, _
    ByVal Flags As Long, _
    ByVal Reserved As Long) As Long


I tried to rename the first one to MAPISendMailOE and then choose the function to call based on the operating system (determined when the database is first opened).   

When I rename the function, I get the error  "Can't find DLL entry point MAPISendEmailOE in c:\program files\outlook express\msoe.dll" on the WinXP computer.   Same type of problem if I rename the Vista version.


How do I have both functions available and call the appropriate one for the specific computer?


Thanks
Carolyn Johnson
St Louis, MO




More information about the AccessD mailing list