![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |