Question : Outlook 2007 - Auto Create Distribution List

I work at a large institution using MS Exchange.  An e-mail was sent to me with multiple names from their local distribution list.  I've been asked to update the information requested, periodically, and send the updated to this list of people that I can see in my To: line, and who have institutional e-mail addresses.

How can I automatically create a new local distribution list from the names in this e-mail header, without individually adding each one?

Thanks,

Cook

Answer : Outlook 2007 - Auto Create Distribution List

Alternatively keep the API call at the top as before and use:

Chris
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
Sub printExcelAttachments()
Dim itms As Object
Dim itm As Object
Dim sh As Object
Dim att As Object
Dim objFSO As Object
Dim objTempFolder As Object
Dim dlg As FileDialog
Dim xlApp As Object
Dim xlWB As Object
Dim xlWS As Object
 
    Set itms = Application.ActiveExplorer.Selection
 
    'On Error Resume Next
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objTempFolder = objFSO.GetSpecialFolder(2)
    Set xlApp = CreateObject("excel.application")
    For Each itm In itms
        For Each att In itm.Attachments
            Select Case LCase(Right(att.Filename, Len(att.Filename) - InStrRev(att.Filename, ".")))
            Case "xls"
                att.SaveAsFile objTempFolder & "\" & att.Filename
                xlApp.workbooks.Open objTempFolder & "\" & att.Filename
                For Each xlWS In xlApp.workbooks(1).worksheets
                    xlWS.PrintOut
                Next
                xlApp.workbooks(1).Close False
            Case "xlsm"
                att.SaveAsFile objTempFolder & "\" & att.Filename
                xlApp.workbooks.Open objTempFolder & "\" & att.Filename
                For Each xlWS In xlApp.workbooks(1).worksheets
                    xlWS.PrintOut
                Next
                xlApp.workbooks(1).Close False
            Case "doc"
                att.SaveAsFile objTempFolder & "\" & att.Filename
                ShellExecute 0&, "Print", objTempFolder & "\" & att.Filename, 0&, 0&, 0&
            Case "pdf"
                att.SaveAsFile objTempFolder & "\" & att.Filename
                ShellExecute 0&, "Print", objTempFolder & "\" & att.Filename, 0&, 0&, 0&
            End Select
        Next
    Next
    xlApp.Quit
End Sub
Random Solutions  
 
programming4us programming4us