Populate BCC field with all Contacts within a Contact Folder

  • Thread starter Thread starter Gil Araujo
  • Start date Start date
G

Gil Araujo

Hello
I am a newbie on outlook VBA programing.
So far i was able to create a new macro/code that will create me 2 new
emails, populate Subject and add attachements automaticly.

However now i have a problem in populating the BCC lists.
I send this emails to all the contacts within a 2 especific contact folders.
For example purpuses lets say Contact Folder 1 is Called "Newsletter1" and
Contact folder2 is called "NewsLetter2".

So for the 2 new emails that will pop up when i execute the macro i would
like the macro to add in one all the emails in the contact folder
"Newsletter1" to the bcc field, and the other all the emails in the contact
folder "NewsLetter2" to the bcc folder too.

Is this possible? can anyone give me a little help getting through it plz?

I attached below the code i have written so far, it works perfectly so far
but it would be a time saver if the code could inspect the contact folder and
add automaticly all the emails of the contacts in it.

Best Regards
Gil



Sub NewMail()
Dim objOLApp As Outlook.Application
Dim objOLApp2 As Outlook.Application
Dim MyContacts As Outlook.ContactItem
Dim NewMail As Outlook.MailItem
Dim NewMail2 As Outlook.MailItem

Set objOLApp = New Outlook.Application
Set objOLApp2 = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
Set NewMail2 = objOLApp2.CreateItem(olMailItem)

NewMail.Subject = "Information - " & Date
NewMail.Display
NewMail.Attachments.Add ("\\\server\fax\temp2.xls")
NewMail.Attachments.Add ("\\server\fax\temp.xls")


NewMail2.Subject = "Information 1 - " & Date
NewMail2.Display
NewMail2.Attachments.Add ("\\\server\fax\temp2.xls")
NewMail2.Attachments.Add ("\\server\fax\temp.xls")


End Sub
 
Not really.

But i am very new on this which makes me ask, how can i use mail merge.

The code i was able to make so far was a trial an error attempts from other
ppl codes i found over the internet and a lot of googling. but to populate
the bcc field i am not being able to find answers.

Could you help me plz, guide me over the necessary steps?

Best Regards
 
Back
Top