#31
|
||||
|
||||
I don't need you to provide the macro code - I need the documents. You can attach them by putting them into a zip archive first, then attaching that.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#32
|
|||
|
|||
It's working again, it turns out trying to format the <<Data>> field into 4 column layout, then messes with it somehow - resulting in only the top row.
Odd. I guess im stuck with some text appearing like this: Date Inv ReferenceInvoice Detail Invoice Amount |
#33
|
|||
|
|||
Quote:
*Crying* |
#34
|
|||
|
|||
I had it working - and now it's stopped again?!
Im definitely doing something, but cannot for the life of me figure out what! I have even looked at the DataSouce and it looks like this (see attached). It is correct, the tables are merged, I receive the email. But I only receive the first line of the table? |
#35
|
||||
|
||||
See attached.
I've made a few minor changes to the last part of the macro code so your indenting of the data will be respected, but that's about all on the macro side of things. I've also applied some tab-stops to your 'Email Merge Main Document' to manage the alignments and reformatted the Invoice Amount field to put the £ symbol into the field and apply a thousands separator. That said, you have no control over whether your recipients will view the emails with quite the same layout as you send them. I also had to clear out some empty rows from your workbook. Also, the code presently sends the output to a new document (for testing), but I'm sure by now you know how to change that.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#36
|
|||
|
|||
Advancing the multiple rows, to multiple recipients
Hi Marco,
Long time! I was hoping for your wizardry/ sagely advice once more... I am now trying to use the catalog mail merge > merging the tables> Then sending the tables to multiple recipients...i.e. To & CC. I have done a little looking around and this is what I have found so far: Code:
With oItem .Subject = mysubject .body = ActiveDocument.Content Set Datarange = Maillist.Tables(1).Cell(Counter, 1).Range Datarange.End = Datarange.End - 1 .To = Datarange For i = 2 To Maillist.Tables(1).Columns.Count Set Datarange = Maillist.Tables(1).Cell(Counter, i).Range Datarange.End = Datarange.End - 1 .Attachments.Add Trim(Datarange.Text), olByValue, 1 Next i .CC = "Firstemailaddress; secondemailaddress" .BCC = "Firstemailaddress; secondemailaddress" .Send End With Last edited by macropod; 10-13-2014 at 01:58 PM. Reason: Added code tags & formatting |
#37
|
||||
|
||||
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.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#38
|
|||
|
|||
Trouble inserting extra code
Quote:
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 |
#39
|
||||
|
||||
Upon a closer review I've realised the mailmerge process my code uses, which relies on Word's VBA object model, doesn't support CC and BCC output. Accordingly, a substantial re-write of the code would be required, with Outlook Automation, in order for that to be done. I really don't know enough of how Outlook works to do that. You may get better results using one of the Many-to-One Mail Merge add-ins, from:
Graham Mayor at http://www.gmayor.com/ManyToOne.htm; or Doug Robbins at http://bit.ly/1hduSCB
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mail merge in excel to send pdf forms | heyullama | Excel | 7 | 12-01-2013 03:32 PM |
Mail Merge Many URLs in one email by common email address | instantaphex | Mail Merge | 3 | 04-29-2013 05:46 PM |
Mail Merge to email, changing images on email layout | ginelli | Mail Merge | 18 | 02-23-2013 09:47 AM |
Mail Merge with Booklets is Merging all documents into One stapled Booklet | 15Degrees | Mail Merge | 1 | 01-31-2013 02:06 AM |
Send e-mail message in Finish & Merge | CDTom | Mail Merge | 1 | 08-24-2012 12:52 AM |