Reply
 
Thread Tools Display Modes
  #1   Report Post  
happy_cleo
 
Posts: n/a
Default Mail Merge - automatic from flat file - how to ignore messages

Word 2002. I want to automate a mail merge e.g. Double click on document
name, document opens, merges data (from flat file), prints, closes. 1) I have
created a merge document (for invoices). 2) My (.txt) file has fewer data
fields than my header record. 3) I have an AutoOpen macro to merge the data.
4) Before the macro runs, Word asks for confirmation of the data delimiters
then gives me several message boxes to say RECORD 1 (etc) CONTAINED TOO FEW
DATA FIELDS.

Q) How do I stop the warning messages and the delimiter confirmation box
from appearing and thus stop the need for user intervention?

Thanks!
  #2   Report Post  
Anne Troy
 
Posts: n/a
Default

Remove the unused merge fields from your main document.
*******************
~Anne Troy

www.OfficeArticles.com


"happy_cleo" wrote in message
...
Word 2002. I want to automate a mail merge e.g. Double click on document
name, document opens, merges data (from flat file), prints, closes. 1) I

have
created a merge document (for invoices). 2) My (.txt) file has fewer data
fields than my header record. 3) I have an AutoOpen macro to merge the

data.
4) Before the macro runs, Word asks for confirmation of the data

delimiters
then gives me several message boxes to say RECORD 1 (etc) CONTAINED TOO

FEW
DATA FIELDS.

Q) How do I stop the warning messages and the delimiter confirmation box
from appearing and thus stop the need for user intervention?

Thanks!



  #3   Report Post  
Peter Jamieson
 
Posts: n/a
Default

You have to have the same number of fields in each data record as you do in
the header. I don't think anything will work until you fix that. I would
guess that you are trying to use the same header file with several data
files, each with a subset of the fields specified in the header file, but I
think you will have to change your approach. I would certainly consider
changing the format of the data source or using some preliminary code to
import the data into a single structure (perhaps an Access table), but if
that is not feasible I would consider starting with a main document that has
neither a header nor a data file attached, and attach both programmatically.

As far as the delimiters are concerned, what happens depends on the
delimiter, the method Word uses to connect to the data, and whether Word is
able to decide what the delimiters are (it may of course get it wrong). If
you are using header files, use the same delimiter as in the data file (but
even that may not be enough). If you are using OLEDB or the internal text
converter to connect tot he data, there is no way to specify the delimiter
programmatically. If you are using ODBC, you may be able to specify the
field delimiter in the SCHEMA.INI file that you can create by configuring
the appropriate ODBC DSN, but you cannot use a record delimiter other than
CRLF (or similar).

Peter Jamieson

"happy_cleo" wrote in message
...
Word 2002. I want to automate a mail merge e.g. Double click on document
name, document opens, merges data (from flat file), prints, closes. 1) I
have
created a merge document (for invoices). 2) My (.txt) file has fewer data
fields than my header record. 3) I have an AutoOpen macro to merge the
data.
4) Before the macro runs, Word asks for confirmation of the data
delimiters
then gives me several message boxes to say RECORD 1 (etc) CONTAINED TOO
FEW
DATA FIELDS.

Q) How do I stop the warning messages and the delimiter confirmation box
from appearing and thus stop the need for user intervention?

Thanks!



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I mail merge a .csv file, matching fields, into a Word doc Fluffy from Wisconsin Microsoft Word Help 3 May 19th 05 01:38 PM
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
Mail Merge: How do you merge to file but create separate files david Mailmerge 1 March 22nd 05 07:11 AM
How to attach a PDF file to a Mail Merge Email from Word? RPMissions Mailmerge 1 January 16th 05 07:06 AM
Mail merge toolbar unavailable after SP3 R Scott Lowden Mailmerge 1 December 1st 04 06:24 PM


All times are GMT +1. The time now is 09:12 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"