Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word MailMerge Doesn't Recognize Delimiters

Status
Not open for further replies.

MDHulen

Programmer
Aug 18, 2009
6
0
0
US
When we open a data source with the following code, the field delimiter and record delimiter are not recognized. Is there any way to set the field and record delimiter with code? The field delimiter is a tab and the record delimiter is $. We cannot use a paragraph mark for the record delimiter.

prn_report.ActiveDocument.MailMerge.OpenDataSource(ls_data_file)
 
Hi MDHulen,

AFAIK Word can work with tab delimiters for fields, but not with '$' as a record delimiter. Record delimiters must be represented as new lines - a '$' represents nothing more than a character within a field.

Why do you say you can't have records separated by paragraph marks?




Cheers
[MS MVP - Word]
 
We have a part of the data source that is formatted with paragraph marks and will be in the report we are creating. Word is not recognizing the tabs in the second data source. Is there any way to set the field and record delimiters in Word? We need to upgrade from Word 2003 to Word 2007 and this is causing us a big problem.
 
Hi MDHulen,

A mailmerge can have only one data source, so your reference to two data sources suggests you'll need to combine them somehow before running your mailmerge.

You could try converting your data source(s) to a single Word table, then use that table as your mailmerge data source. With a Word table as your mailmerge data source, each record can consist of multiple paragraphs.


Cheers
[MS MVP - Word]
 
We open one data source at a time and merge it. Why can we use the $ as a record delimiter in Word 2003 and not in Word 2007? Why isn't there a way to define the field and record delimiters?
 
I don't have any trouble doing a mail merge in Word 2007 using a text file with tab as the field delimiter and $ as the record delimiter as the source file.


--Lilliabeth
 
We can do the mail merge in Word 2007 using a text file with tab as the field delimiter and $ as the record delimiter but have to select the delimiters from a popup box. We need to be able to do this without having to enter the values in the popup box. Our users won't know what to enter.
When we open the data source with the following code, Word asks us to enter the delimiter values.
prn_report.ActiveDocument.MailMerge.OpenDataSource(ls_data_file)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top