View Single Post
 
Old 10-24-2014, 02:18 AM
toughiv toughiv is offline Windows Vista Office 2010 32bit
Novice
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default Trouble inserting extra code

Quote:
Originally Posted by macropod View Post
Hi toughiv,

I've been rather busy lately with Uni assignments and the like. Your code snippet seems somewhat unrelated to the macro from the tutorial. With the tutorial's approach, all you need do is to add two extra columns after the existing 'Recipient' column, to hold the CC and BCC mergefields, then make a few changes to the macros:

1. In the 'RunMerge' macro, after:
.MailAddressFieldName = "Recipient"
insert:
.CC = "CCRecipient"
.BCC = "BCCRecipient"

2. In the EmailMergeTableMaker macro, change:
j = 2
to:
j = 4
and change:
.Cell(1, 2).Range.Text = "Data"
to:
.Cell(1, 2).Range.Text = "CCRecipient"
.Cell(1, 3).Range.Text = "BCCRecipient"
.Cell(1, 4).Range.Text = "Data"

Your code snippet also suggests you're contemplating individualised email subjects. Doing that, of course presupposes you have a data field for that. If you do have such a field, it's just a matter of extending the above changes to accommodate yet another column in the mailmerge table.
Hi Macro,

How's Uni going? Hopefully not too hectic?

Thanks for taking the time to help,

I am having a problem, maybe it is because of how I have inserted the VBA lines? Or maybe it is due to the setup of the "RunMerge" Category MM Word file...

I say that last point because Im not entirely sure how the code works for the table (i.e. how it knows the recipient is where I have "email address" merge field.

I have attached a few photos:

1) The error message I am receiving, including the code and the merge document. (That was just a picture)
2) A template of the spreadsheet I am working with.
3) The 123Pow document, excuse the name :P, where I run the macro from.

Hopefully, you'll be able to point me in the right direction!

Thanks!!
MacroPod_Error.jpg

Trial_CC.xlsx

123Pow.docm
Reply With Quote