//**************************************************************************** // $Module type: FUNCTION // $Module name: EmailAddressBookEntry // $Author : NAME // Created : 15-09-99 @ 14:24 // // Description // This function does make selection of ONE email address from the address // book possible. Can be used in an application that stores the email adres // in a record of a datafile. If more than one address is selected from the // addressbook only the first one will be returned. // // Specify username, password for mapi logon function if necessary // // $Rev History // 27/10/99 Changed from SEND LOGON to GET LOGON // Changed from SEND LOGOFF to GET LOGOFF // 15-09-99 VO Module header created //**************************************************************************** Function EmailAddressBookEntry Returns String String sReceiverAddress Integer iRetval iReceivers iVoid Handle hSession hPreviousSession hMapiSession hReceiversArray Move oMapiSession To hMapiSession Get phSessionID Of hMapiSession To hPreviousSession If (hPreviousSession = 0) Begin Get Logon Of hMapiSession "" "" MAPI_NEW_SESSION To iRetval If (iRetval <> SUCCESS_SUCCESS) Begin Get Logon Of hMapiSession "" "" MAPI_LOGON_UI To iRetval If (iRetval <> SUCCESS_SUCCESS) Begin Send Stop_Box ("Errorcode:" * String (iRetval)) "MAPI Logon error" End End End Get phSessionID Of hMapiSession To hSession If (hSession <> 0) Begin Send DoClearReceiversList To hMapiSession Get AddressBook Of hMapiSession "Select an EMail address" To iRetval If (iRetval = SUCCESS_SUCCESS) Begin Move (oReceiversArray (hMapiSession)) To hReceiversArray Get ReceiverCount Of hReceiversArray To iReceivers If (iReceivers >= 1) Begin If (iReceivers > 1) Begin Send Info_Box "You have selected more than one address\nThis function will return only the first one." "Message" End Get ReceiverAddress Of hReceiversArray 1 To sReceiverAddress End End If (hPreviousSession = 0) Begin Get Logoff Of hMapiSession To iVoid Get phSessionID Of hMapiSession To hSession If (hSession <> 0) Begin Send Stop_Box "MAPI logoff failed!" End End End Else Begin Send Stop_Box "MAPI logon failed!" End Function_Return sReceiverAddress End_Function // EmailAddressBookEntry