Add distribution list in email on VBA

as586

New Member
Joined
Nov 28, 2010
Messages
12
Hi, I am trying to write a macro to add an email distribution list in bcc on an email in Outlook.

Could anyone please help me with this?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Is the list in an excel spreadsheet? If Excel Which Column holds the email addresses do you want names in the body of the email or is it just a message not indicating any names? Are they to all go into one email or individual emails? There plenty of YouTube videos you could study.
 
Upvote 0
Is the list in an excel spreadsheet? If Excel Which Column holds the email addresses do you want names in the body of the email or is it just a message not indicating any names? Are they to all go into one email or individual emails? There plenty of YouTube videos you could study.
Hi Trevor, the distribution list is in my contacts folder in Outlook, and the list would be going into 1 email. Thanks
 
Upvote 0
I have added comments where you will need to change things.

VBA Code:
Sub SendEmailDist()
Dim OlApp As Object 'Use object don't need to set reference
Dim OlMail As Object

Set OlApp = CreateObject("Outlook.Application")
Set OlMail = OlApp.CreateItem(0) 'Create email

On Error Resume Next
With OlMail
    
    .BCC = "Test2" 'Replace Distribution List Name
    .Subject = "Distribution" 'Change title
    .Body = "What you want to say" 'Add your content
    .Display 'Once checked change to .Send
End With
On Error GoTo 0

Set OlMail = Nothing
Set OlApp = Nothing
End Sub
 
Upvote 0
Happy to Help thank you for letting me know.
 
Upvote 0

Forum statistics

Threads
1,215,013
Messages
6,122,690
Members
449,092
Latest member
snoom82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top