simple mail merge from TXT file fails ("records empty / none matched query" ???)

Hello there!

 

I’m trying to do a mail merge from a plain text (TXT) source file, and I can’t get it to work. My test scenario is *extremely* simple - just 1 record that contains 2 fields.  I've run 2 tests, as detailed below:

 

*** TEST #1 ***

 

My input file contains everything between (but not including) the percent signs:

%* “08-03-10”,”John Doe”%

(Note: this file was generated from a Microsoft Word document that contains fields, using Word's "Save Form Data as Delimited Text File" / "Save a Copy as... TXT" functionality).

For delimiters, I specify:

field delimiter = ,(i.e. comma)

record delimiter = (enter)

And the error message I get after pressing OK is:

          Word could not merge the main document with the data source because the data  records were empty or no data records matched your query options.

*** TEST #2 ***

So, I tried removing the initial asterisk and space (are those 2 characters necessary?), so that now my input file contains everything between (but not including) the percent signs:

%“08-03-10”,”John Doe”%

And for delimiters, I specify the same things (field delim=comma and record delim=(enter)).

And I get the same error message:

          Word could not merge the main document with the data source because the data  records were empty or no data records matched your query options.

Arrrghh!! Can anyone tell me why this isn’t working? MANY thanks for your help - and have a great day, everyone :-)

Answer
Answer

It seems that you may not have any field names in your data source.  What I would do is to open the .txt file in Excel and insert a row at the top of the file into the cells of which you insert field names, get rid of any asterisks that are not part of the actual data and then save and use the Excel file as the data source,

-- Hope this helps.

Doug Robbins - Word MVP,
dkr[atsymbol]mvps[dot]org
Posted via the Community Bridge

"PRaBennett" wrote in message news:*** Email address is removed for privacy ***...

Hello there!

I’m trying to do a mail merge from a plain text (TXT) source file, and I can’t get it to work. My test scenario isextremely simple - just 1 record that contains 2 fields.  I've run 2 tests, as detailed below:

*** TEST #1 ***

My input file contains everything between (but not including) the percent signs:

%** “08-03-10”,”John Doe”%*

(Note: this file was generated from a Microsoft Word document that contains fields, using Word's "Save Form Data as Delimited Text File" / "Save a Copy as... TXT" functionality).

For delimiters, I specify:

*field delimiter = ,*(i.e. comma)

*record delimiter = (enter)*

And the error message I get after pressing OK is:

          Word could not merge the main document with the data source because the data  records were empty or no data records matched your query options.

**

**** TEST #2 ****

So, I tried removing the initial asterisk and space (are those 2 characters necessary?), so that now my input file contains everything between (but not including) the percent signs:

%*“08-03-10”,”John Doe”*%

And for delimiters, I specify the same things (field delim=comma and record delim=(enter)).

And I get the same error message:          Word could not merge the main document with the data source because the data  records were empty or no data records matched your query options.

Arrrghh!! Can anyone tell me why this isn’t working? MANY thanks for your help - and have a great day, everyone :-)


Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 1,245 Applies to: