Consultor Eletrônico



Kbase 21829: ActiveX: How to Access the Outlook AddressBook
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/02/2002
SUMMARY:

This is an example showing how to access the Outlook AddressBook.

SOLUTION:

DEFINE VARIABLE houtlook AS Com-handle NO-UNDO.
DEFINE VARIABLE hnamespace AS Com-handle NO-UNDO.
DEFINE VARIABLE hfolder AS Com-handle NO-UNDO.
DEFINE VARIABLE hitem AS Com-handle NO-UNDO.
DEFINE VARIABLE x AS integer NO-UNDO.


CREATE "outlook.application" houtlook.

hnamespace = houtlook:getnamespace("MAPI").
hfolder = hnamespace:addresslists:ITEM(1).

DO X=1 TO hfolder:addressentries:COUNT():
hitem = hfolder:addressentries:ITEM(X).
MESSAGE hitem:NAME + " " hitem:address VIEW-AS ALERT-BOX.
END.


RELEASE OBJECT hitem.
RELEASE OBJECT hfolder.
RELEASE OBJECT hnamespace.
RELEASE OBJECT houtlook.