Y
Yann Abrassart
Hello,
I want to manage my Outlook distribution lists with Access. I found on
Microsoft website a reference about "HOWTO : Work with Distribution Lists
Using CDO(1.x) from Visual Basic", available here :
http://support.microsoft.com/?kbid=178787
I can add a distribution list (AddDLToPAB) and contacts (AddUserToPAB) to my
adress book. But, I can't add contact to a distribution list (AddUserToDL).
I use french versions of Access 2002 and Outlook 2002
By using the debugger, I get :
Public Sub Main()
Dim oAddressList As AddressList
Dim oAddressEntry As AddressEntry
Dim oNewUserAddressEntry As AddressEntry
If MapiLogon() = True Then
Set oAddressList = AddressBookExists("Contacts")
I replaced "Personal Address Book" into "Contacts"
If Not oAddressList Is Nothing Then
'TO DO: You will want to customize the string values
'in the next two lines.
Set oNewUserAddressEntry = _
AddUserToPAB(oAddressList, "Custom New User")
Set oAddressEntry = AddDLToPAB(oAddressList, "My Custom DL")
Here, oAddressEntry value is "", that sounds wrong ...
If Not oAddressEntry Is Nothing Then
'TO DO: Recipient to be added on next line should be
'customized.
If AddUserToDL(oAddressEntry, "Custom New User") = True Then
MsgBox "Added new user and DL, and new member in the DL"
Else
MsgBox "Adding a user to the DL didn't work"
Here, I get this MsgBox.
End If
Else
MsgBox "Custom DL wasn't added to the Personal Address Book"
End If
Exit Sub
Else
MsgBox "There is no PAB Service installed on this machine"
Exit Sub
End If
End If
End Sub
Thanks for your help.
I want to manage my Outlook distribution lists with Access. I found on
Microsoft website a reference about "HOWTO : Work with Distribution Lists
Using CDO(1.x) from Visual Basic", available here :
http://support.microsoft.com/?kbid=178787
I can add a distribution list (AddDLToPAB) and contacts (AddUserToPAB) to my
adress book. But, I can't add contact to a distribution list (AddUserToDL).
I use french versions of Access 2002 and Outlook 2002
By using the debugger, I get :
Public Sub Main()
Dim oAddressList As AddressList
Dim oAddressEntry As AddressEntry
Dim oNewUserAddressEntry As AddressEntry
If MapiLogon() = True Then
Set oAddressList = AddressBookExists("Contacts")
I replaced "Personal Address Book" into "Contacts"
If Not oAddressList Is Nothing Then
'TO DO: You will want to customize the string values
'in the next two lines.
Set oNewUserAddressEntry = _
AddUserToPAB(oAddressList, "Custom New User")
Set oAddressEntry = AddDLToPAB(oAddressList, "My Custom DL")
Here, oAddressEntry value is "", that sounds wrong ...
If Not oAddressEntry Is Nothing Then
'TO DO: Recipient to be added on next line should be
'customized.
If AddUserToDL(oAddressEntry, "Custom New User") = True Then
MsgBox "Added new user and DL, and new member in the DL"
Else
MsgBox "Adding a user to the DL didn't work"
Here, I get this MsgBox.
End If
Else
MsgBox "Custom DL wasn't added to the Personal Address Book"
End If
Exit Sub
Else
MsgBox "There is no PAB Service installed on this machine"
Exit Sub
End If
End If
End Sub
Thanks for your help.