Populate BCC field with all Contacts within a Contact Folder

  • Thread starter Thread starter Gil Araujo
  • Start date Start date
Status
Not open for further replies.
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.

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
 
Is there a reason you're not using mail merge?

--JP

On Jan 13, 9:13 am, Gil Araujo <Gil Ara...
wrote:
> 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".
>
 
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?

"JP" wrote:


> Is there a reason you're not using mail merge?

> --JP

> On Jan 13, 9:13 am, Gil Araujo <Gil Ara...
> wrote:
> > 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".
> >

> .
>
 
Can Anyone help me plz?

Thank you

"Gil Araujo" wrote:


> 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.

>

> 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
 
There are a lot of intermediate steps involved. If you don't know

anything about mail merge, you'll need to understand how it works

before anyone can provide specific advice. It's much easier to help

you if you need help with a specific task, not something generic like

how to mail merge. Try starting here:

http://www.outlook-tips.net/howto/mailmerge.htm

http://www.howto-outlook.com/howto/mailmerge.htm

--JP

On Jan 14, 4:15 am, Gil Araujo <GilAra...
wrote:
> 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?

>

>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
C Populate form data into message body Outlook VBA and Custom Forms 1
cbufacchi Outlook 365 Populate custom Outlook Appoint form Outlook VBA and Custom Forms 2
B Outlook 365 Populate Outlook Task UDFs from a UDF text string Outlook VBA and Custom Forms 2
D Cannot populate certain UserProperties in Outlook from Excel Outlook VBA and Custom Forms 2
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
C Trying to populate an appointment ComboBox from Excel Outlook VBA and Custom Forms 2
A Populate Listbox from Txt File Outlook VBA and Custom Forms 0
A Populate Textbox from Txt File Outlook VBA and Custom Forms 1
M Adding Macro to populate "to" "subject" "body" not deleting email string below. Outlook VBA and Custom Forms 5
Diane Poremsky Outlook VBA: Use a Text File to Populate a ListBox Using Outlook 0
T populate calendar with appointments and send reminders Using Outlook 1
A Populate Excel from Outlook Userform Outlook VBA and Custom Forms 3
J Live Meeting Location populate from body Outlook VBA and Custom Forms 4
A How can I populate a dropdown list? BCM (Business Contact Manager) 4
rohit I want to Populate Popup box while sending any email with attachment. Outlook VBA and Custom Forms 4
rohit I want to Populate Popup box while sending any email with attachment Using Outlook 1
A Cannot populate IMAP folders Using Outlook 1
S Pre populate subject + body + attachment to already open email in outlook 2007 Using Outlook 2
S Populate textbox values from one form to another form. Using Outlook 0
B Auto Populate From Field Using Outlook 3
G Populate an Outlook 2007 template with spreadsheet data. Outlook VBA and Custom Forms 1
R Populate Form with appointments from Calendar Outlook VBA and Custom Forms 1
J populate word template from Outlook custom form Outlook VBA and Custom Forms 2
M Create new Contacts folder and populate it from Access Outlook VBA and Custom Forms 1
A Macro - Open new message, populate from and subject fields, and message text Outlook VBA and Custom Forms 1
G Macro: Create New Message and Auto populate To Field Outlook VBA and Custom Forms 5
S populate body with Word data Outlook VBA and Custom Forms 7
L how to populate multiple users contacts Outlook VBA and Custom Forms 9
A Populate task field based on value of other field Outlook VBA and Custom Forms 9
B BCC issues after changing root folder path for gmail Using Outlook 1
M CC AND BCC Using Outlook 1
C Create new Message with shared contacts & BCC'ing recipients Outlook VBA and Custom Forms 0
N Outlook rules don't create a copy for bcc'ed emails Using Outlook 3
M Forward Appointment as BCC with VBScript Outlook VBA and Custom Forms 7
O Outlook on Android - add BCC Using Outlook 2
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
G Bcc help - Preventing multiple forwards from a bcc'd distribution group Using Outlook 1
J Will BCC messages still deliver if TO address fails Outlook 2013 Using Outlook 3
V Please help if you can. Problems with Bcc BCM (Business Contact Manager) 3
S BCC lists addressees Using Outlook 2
T bcc and Google imap Using Outlook 3
V Mark BCC when emails is sent from specific account Outlook VBA and Custom Forms 2
B Auto BCC VBA macro: how to add exceptions? Using Outlook 28
V using Bcc in Outlook.com 2013 Using Outlook 1
J Cc and Bcc not working Using Outlook 8
K received bcc as encrypted Using Outlook 12
V Contact group: addresses in BCC? Using Outlook 2
C a BCC script question Using Outlook 1
C BCC - How many email address will it accomodate? Using Outlook 2
P help me plase !!! outlook 2007 I can see mail Bcc Using Outlook 1

Similar threads

Back
Top