Outlook Address Book

Emma

Member
Hi,

When creating an email, the user can access their own address book. What I
want to do is display the entries from the company address book in the same
way as in outlook, i.e combo box selection, but in a program I have written.

Any ideas?

Emma.
 

cybvek

New Member
I don't know I understund well, what you want, but if you want to import outlook addresses try this:

CREATE "OutLook.Application" ghPMAppl.
ASSIGN ghPMNameSpace = ghPMAppl:GetNameSpace("MAPI")
hFolders = ghPMNameSpace:Folders
ghPMAddrLists = ghPMNameSpace:AddressLists("Example_addresses_folder_name")
ghPMAddressEntries = ghPMAddrLists:AddressEntries.
ghPMAddressEntry = ghPMAddressEntries:GetFirst.
.
IF ghPMAddressEntry = 0 OR
ghPMAddressEntry = ?
THEN RETURN.
REPEAT:
CREATE TT_Email.
ASSIGN TT_Email.Name = ghPMAddressEntry:Name
TT_Email.Address = ghPMAddressEntry:Address
.
FIND CURRENT TT_Email NO-LOCK
NO-ERROR.
ASSIGN ghPMAddressEntry = ghPMAddressEntries:GetNext.
IF ghPMAddressEntry = 0 THEN LEAVE.
END.

Regards,

Viktor

Originally posted by Emma
Hi,

When creating an email, the user can access their own address book. What I
want to do is display the entries from the company address book in the same
way as in outlook, i.e combo box selection, but in a program I have written.

Any ideas?

Emma.
 

cybvek

New Member
Originally posted by KubiaK
This might work with Outlook, but do you know if there's an equivalent for Outlook Express ?

Maybe this, but I'm not sure, because I'can test it (MAPI.Session class is not installed...) (NT4) I tried to registery the cdo.dll but nothing happens; at other machine (W98ME) call the outlook MAPI so if you have installed outlook wich overwrites the express MAPI functions I don't know how can you reach the express, somebody any idea?:

DEFINE VARIABLE hComSession AS COM-HANDLE.
DEFINE VARIABLE hAEntry AS COM-HANDLE.
DEFINE VARIABLE hAEntries AS COM-HANDLE.

CREATE "MAPI.Session" hComSEssion.
hComSession:logon("", No, Yes, 0).

hAEntries = hComSession:AddressLists(1):AddressEntries.
hAEntry = hAEntries:GetFirst.

IF hAEntry = 0 OR
hAEntry = ? THEN RETURN.

REPEAT:
MESSAGE hAEntry:NAME " - "hAEntry:Address VIEW-AS ALERT-BOX.
.
ASSIGN hAEntry = hAEntries:GetNext.
IF hAEntry = 0 THEN LEAVE.
END.

hComSession:LogOff.
RELEASE OBJECT hComSession.


Regards,

Viktor
 
Top