Question

Q: simple mail merge from TXT file fails ("records empty / none matched query" ???) This thread is locked from future replies

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

A:

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 - Word MVP

dougrobbinsmvp@gmail.com

I AM NOT CONCERNED ABOUT MY EMAIL ADDRESS BEING VISIBLE!!!!

Did this solve your problem?

Sorry this didn't help.



 
Question Info

Views: 899 Last updated: December 21, 2017 Applies to: