getting distribution list from Contacts 
Author Message
 getting distribution list from Contacts

I am automating Outlook from XL and would like to set a
code reference to a distribution list that is kept in the
Contacts collection.

Would someone please help me with the syntax or point me
to a site where I can find an example of valid code to do
this?  Once I have the list reference, I believe that I
can take it from there.

Also, is there a way to determine with the code whether
the Distribution List is kept with the Contacts or the
Address book?

Thanks,

Joe



Sun, 10 Oct 2004 23:51:48 GMT  
 getting distribution list from Contacts
Joe,

here's an example I wrote yesterday in Access:

Sub EmailResults(Result As Boolean)
Dim objApp As Object
Dim objMail As Object
Dim strRecipient1 As String
Dim strBody As String
Dim strSubject As String

Set objApp = CreateObject("outlook.application")
Set objMail = objApp.CreateItem(0)

strRecipient1 = "IM2"  'Name of distribution list

If Result Then
    strSubject = "IM2 Data Processing Succeeded"
    strBody = "The batch finished processing at " & Now()
Else
    strSubject = "IM2 Data Processing Failed"
    strBody = "The batch finished processing at " & Now()
End If

With objMail
    .Subject = strSubject
    .Recipients.Add strRecipient1
    .Body = strBody
    .Send
End With

Set objApp = Nothing
Set objMail = Nothing
End Sub

Kevin

Quote:
>-----Original Message-----
>I am automating Outlook from XL and would like to set a
>code reference to a distribution list that is kept in the
>Contacts collection.

>Would someone please help me with the syntax or point me
>to a site where I can find an example of valid code to do
>this?  Once I have the list reference, I believe that I
>can take it from there.

>Also, is there a way to determine with the code whether
>the Distribution List is kept with the Contacts or the
>Address book?

>Thanks,

>Joe

>.



Mon, 11 Oct 2004 04:31:36 GMT  
 getting distribution list from Contacts
Thanks Kevin
Quote:
>-----Original Message-----
>Joe,

>here's an example I wrote yesterday in Access:

>Sub EmailResults(Result As Boolean)
>Dim objApp As Object
>Dim objMail As Object
>Dim strRecipient1 As String
>Dim strBody As String
>Dim strSubject As String

>Set objApp = CreateObject("outlook.application")
>Set objMail = objApp.CreateItem(0)

>strRecipient1 = "IM2"  'Name of distribution list

>If Result Then
>    strSubject = "IM2 Data Processing Succeeded"
>    strBody = "The batch finished processing at " & Now()
>Else
>    strSubject = "IM2 Data Processing Failed"
>    strBody = "The batch finished processing at " & Now()
>End If

>With objMail
>    .Subject = strSubject
>    .Recipients.Add strRecipient1
>    .Body = strBody
>    .Send
>End With

>Set objApp = Nothing
>Set objMail = Nothing
>End Sub

>Kevin

>>-----Original Message-----
>>I am automating Outlook from XL and would like to set a
>>code reference to a distribution list that is kept in
the
>>Contacts collection.

>>Would someone please help me with the syntax or point me
>>to a site where I can find an example of valid code to
do
>>this?  Once I have the list reference, I believe that I
>>can take it from there.

>>Also, is there a way to determine with the code whether
>>the Distribution List is kept with the Contacts or the
>>Address book?

>>Thanks,

>>Joe

>>.

>.



Mon, 11 Oct 2004 20:27:02 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Outlook Contacts - Distribution Lists

2. Members property of contact folder distribution lists - returns gobbledygook in lovely looking array

3. HELP please for contact from Distribution list

4. Help: Extracting Contact info from distribution list inspector

5. Distribution Lists - How to displaying individual contacts in To field

6. Distribution lists in the Contacts Folder

7. Distribution List or Contact- Identifying each in a Loop

8. Using VBA to Create a Contact Folder Distribution List from MS Access

9. adding a selected contact to a distribution list

10. Adding a contact to a Distribution List

11. Add a contact to a Distribution List

12. HELP please for contact from Distribution list

 

 
Powered by phpBB® Forum Software