using .Addressbook from MAPI.Session object
Posted on 2004-10-13
I have an Exchange 2000 server
Client is Outlook 2003
I have a custom form that is published to the Organizational Forms Library and is not 1 offed.
All the docs I can find say that if it is published in Org Lib then Outlook Security Blocks will be bypassed but I am finding the exact opposite, works a treat in Outlook 2002 but security prompts in 2003.
Can anyone shed some light on this ... please ???
Private Function GetRecipients()
Dim outRecipients 'collection of recipients
Dim outRecipient 'single recipient
Dim strRecipients 'string of recipient names
Dim n 'integer
On Error Resume Next
If moutSession Is Nothing Then
Set moutSession = CreateObject("mapi.session")
moutSession.Logon , , False, False
Set outRecipients = moutSession.Addressbook
strRecipients = ""
For n = 1 To outRecipients.Count
Set outRecipient = outRecipients.Item(n)
strRecipients = strRecipients & outRecipient.Name & ";"
If Len(strRecipients) <> 0 Then
strRecipients = Left(strRecipients, Len(strRecipients) - 1) 'Remove last ";"
GetRecipients = strRecipients
GetRecipients = ""
Set outRecipients = Nothing
Set outRecipient = Nothing