none
Mail Merge unable to identify field delimiter and row delimiter RRS feed

  • Question

  • Hi All,

    We have written a simple vbs to perform mail merge script to automate mail merge of word documents. The data source is a pipe delimited text file. The file has more than 255 fields and some text fields have have more than 60 characters. In certain records word is unable to automatically identify the field delimiter and prompts the user to select the field delimiter and record delimiter. Since we have more than 255 fields in the source file we cannot use Excel as the data source to overcome the issue. We are using word 2007 to perform the mail merge

    Can someone please advise if it would be possible to provide the details of the file delimiter and record delimiter using word api or a workaround to avoid the "Header Field Delimiter screen"

    Regards

    Sumeet

    Tuesday, March 12, 2013 9:30 AM

Answers

  • Hi Sumeet,

    If your data have double quotes, that is liable to cause problems. You might also get better results using tab or comma delimiters rather than pipe delimiters.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, March 12, 2013 11:07 AM
  • Hi Sumeet

    In addition to Paul's remarks, I recall some earlier discussions (years ago) where Peter Jamieson discovered that there are problems if a data record exceeds a certain length. Since you mention > 255 fields and > 60 characters, I have to wonder if this could be the underlying cause for what you're seeing.

    As a test: Use Insert File to bring the text file into a Word document. Make sure there's no "empty" paragraph mark at the beginning or end, then save and close the document. Try using this document as the data source. Does the problem still occur?


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, March 15, 2013 2:54 PM
    Moderator

All replies

  • Hi Sumeet,

    If your data have double quotes, that is liable to cause problems. You might also get better results using tab or comma delimiters rather than pipe delimiters.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, March 12, 2013 11:07 AM
  • Hi Sumeet

    In addition to Paul's remarks, I recall some earlier discussions (years ago) where Peter Jamieson discovered that there are problems if a data record exceeds a certain length. Since you mention > 255 fields and > 60 characters, I have to wonder if this could be the underlying cause for what you're seeing.

    As a test: Use Insert File to bring the text file into a Word document. Make sure there's no "empty" paragraph mark at the beginning or end, then save and close the document. Try using this document as the data source. Does the problem still occur?


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, March 15, 2013 2:54 PM
    Moderator