Here is a function that will open an Outlook Distribution List, and get
each email address.
Sub SendEmail
With Outlook.CreateItem(olMailItem)
.To = GetList("Distribution List Name") 'See function below
.Subject = "Daily Inventory " & sSubject
.Attachments.Add sFile
.Send
End With
End Sub
Function GetList(sWhichList As String) As String
On Error GoTo GetListErr:
Dim objOutlook As New Outlook.Application
Dim objNameSpace As Namespace
Dim Contacts As MAPIFolder
Dim DistList As Outlook.DistListItem
Dim i As Integer
'Open contact list in personal folder, and identify distribution list
Set objNameSpace = GetNamespace("MAPI")
Set Contacts = objNameSpace.Folders("Personal
Folders").Folders("Contacts")'Identify folder hierarchy where your
distribution list is located.
Set DistList = Contacts.Items(sWhichList)
'Enter all members of list into email
For i = 1 To DistList.MemberCount
GetList = GetList & DistList.GetMember(i).Name & ";"
Next
GetListExit:
Set DistList = Nothing
Set objOutlook = Nothing
Set objNameSpace = Nothing
Set Contacts = Nothing
Exit Function
GetListErr:
Resume GetListExit:
End Function