![]() |
|
|
|
#1
|
|||
|
|||
|
Thank you.
Using your example from Mail Merge: Using One Excel File with Multiple Sheets I adapted the database code to use my filenames and column headings etc. as below: Code:
DATABASE \d "Y:\EA Haz Database\New Haz Database Oct - Dec 2019\Test Files\Haz Waste Cover Letter.docx/../DB Info.xlsx" \s " SELECT FORMAT([WHEN], 'DD-MM-YYYY') AS `Date`, [CONSIGN], Format([QTY],'#,##0.00') AS Quantity KG, [DESCRIPTION] AS Description, [ITEM] AS `EWC`, [CLASS] AS Disposal Method FROM [Detail$] WHERE [ID] = Account Ref ORDER BY [WHEN] " \l "15" \b "49" \h The Table headers and contents do not alter from your original layout, however when viewing the Field Code the WHERE ID does alter with each record previewed but I suspect this is just working down my Customer Address Tab. If I ask WORD to update the fields or run a simulation I get "This data source can not be opened because it is not supported by the application". I also receive the error "The SELECT statement includes a reserved word or argument...." Also, after manually editing the code, on occasion the table doesn't render at all but the code is present. ![]() This might be above my pay grade! LOL If I persevere with this, is there a Condition or Argument where the merge only happens if there is an entry within the DB Info.xlsx that will populate the table? I have more Customer Addresses than I do Customers with Collections and don't need to print "blank" letters. |
|
#2
|
|||||
|
|||||
|
Quote:
Quote:
"Y:\EA Haz Database\New Haz Database Oct - Dec 2019\Test Files\Haz Waste Cover Letter.docx/../DB Info.xlsx" is invalid. Did you look at the actual field code in the document attached to that link? Quote:
Quantity KG, Description, Disposal Method, and Account Ref are not properly quoted. See the sample field in the link. Quote:
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Mail merged document and page numbers for table of contents
|
jab40 | Mail Merge | 20 | 04-07-2016 08:25 AM |
Mail merge with dynamic table
|
kidwispa | Mail Merge | 3 | 07-06-2015 02:00 PM |
| Dynamic Mail Merged Table | hanskimber | Mail Merge | 2 | 04-24-2015 11:21 PM |
Mail Merge Into Dynamic Table
|
Jag618 | Mail Merge | 1 | 03-04-2013 11:26 PM |