Skip to Content
CDO & MAPI Programming with Visual Basic:
book

CDO & MAPI Programming with Visual Basic:

by Dave Grundgeiger
October 2000
Intermediate to advanced
384 pages
10h 22m
English
O'Reilly Media, Inc.
Content preview from CDO & MAPI Programming with Visual Basic:

Microsoft’s Helper Functions

Some of the Simple MAPI functions are a little cumbersome to call, to say the least. In particular, it seems a bit excessive to have to call both BMAPIReadMail and BMAPIGetReadMail simply to retrieve a list of messages. Similarly, why should we have to call both BMAPIAddress and BMAPIGetAddress to display the address book and retrieve the list of selected address entries? To help make things a little easier, Microsoft has provided a couple of helper functions in Knowledge Base article Q163216, Updated Mapivb32.bas for Simple MAPI on 32-Bit Platforms. (Search for this article on the Microsoft Developer Network [MSDN] web site at http://msdn.microsoft.com.) The article provides MAPIReadMail, which wraps BMAPIReadMail and BMAPIGetReadMail, and MAPIAddress, which wraps BMAPIAddress and BMAPIGetAddress.

Here is the syntax for the MAPIReadMail function:

Function MAPIReadMail(Session As Long, UIParam AsLong, MessageID As String, Flags 
As Long, Reserved As Long, Message As MAPIMessage, Orig As MapiRecip,RecipsOut( ) 
As MapiRecip, FilesOut( ) As MapiFile) As Long

The parameters are:

Session

The session handle that was obtained in a previous call to MAPILogon. Alternatively, pass to cause MAPI to log on the user and create a session that exists only for the duration of the call. If necessary, a dialog box is displayed to request further logon information from the user.

UIParam

The handle of the window that is to be considered the parent of any dialog boxes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander
COM Programming with Microsoft® .NET

COM Programming with Microsoft® .NET

John Paul Mueller, Julian Templeman

Publisher Resources

ISBN: 156592665XSupplemental ContentCatalog PageErrata