A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Populate BCC field with all Contacts within a Contact Folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 13th 10, 02:13 PM posted to microsoft.public.outlook.program_vba
Gil Araujo
external usenet poster
 
Posts: 1
Default Populate BCC field with all Contacts within a Contact Folder

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
Ads
  #2  
Old January 13th 10, 04:37 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Populate BCC field with all Contacts within a Contact Folder

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

--JP


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

  #3  
Old January 14th 10, 09:15 AM posted to microsoft.public.outlook.program_vba
Gil Araujo[_2_]
external usenet poster
 
Posts: 3
Default Populate BCC field with all Contacts within a Contact Folder

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

"JP" wrote:

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

--JP


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

.

  #4  
Old January 18th 10, 10:18 AM posted to microsoft.public.outlook.program_vba
Gil Araujo[_2_]
external usenet poster
 
Posts: 3
Default Populate BCC field with all Contacts within a Contact Folder

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.

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

  #5  
Old January 19th 10, 09:21 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Populate BCC field with all Contacts within a Contact Folder

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 he

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

Best Regards

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create new Contacts folder and populate it from Access Margaret Bartley[_2_] Outlook and VBA 1 November 29th 09 03:35 PM
Populate task field based on value of other field jparker Outlook and VBA 9 March 12th 09 03:50 PM
Populate Message field based on custom field Kryer Outlook - Using Forms 8 September 7th 07 10:19 PM
Populate combobox with public folder contact Pazuzu Outlook - Using Forms 4 March 15th 06 10:27 AM
Populate Company field from Contact field in custom task form Sue Mosher [MVP-Outlook] Outlook - Using Forms 0 January 20th 06 07:37 PM


All times are GMT +1. The time now is 04:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.