View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Los[_4_] Martin Los[_4_] is offline
external usenet poster
 
Posts: 4
Default Showing the Address Book window

See

http://www.rondebruin.nl/sendmail.htm
or
http://www.rondebruin.nl/cdo.htm (no security warnings)

Hope this helps.

Martin

Karim Benabd ha escrito:

Hello All,

I need your help to get rid of the Outlook security message that shows
up everytime I use this procedure that shows the Address Book window so
that the user can select an email address that will be stored in a
textbox for later use.

I am attaching the procedure and wonder if another way exist to have
the same result and avoid the Outlook security message.

Thanks.
Karim
_______________________________________________
Sub Address(field, shortname, destinataire)
Dim olemsg, sDialogCaption, recips
On Error GoTo Erreur
Set olemsg = CreateObject("MAPI.Session")
olemsg.logon "", "", False, False, 0
sDialogCaption = "Sélectionnez " & field
If Not Err Then
Set recips = olemsg.addressbook(Nothing, sDialogCaption, True,
False, 1, shortname, "", "", 0)
destinataire = recips(1).Name
olemsg.logoff
End If
Set olemsg = Nothing
Set recips = Nothing
Exit Sub
Erreur:
Call Erreur
End Sub