OK, I did not recognise the format as DIF. Can the software used to produce
these files generate a format that Word can use more easily?
My assumption is that Excel does not know what to do with the LABEL
structure and throws it away, but as long as you always know what columns
/should/ be there then it may be possible to deal with that problem by using
a separate header source file in Word.
Some questions:
a. which version(s) of Word do your users have?
b. do they all also have Excel (and are they using the same version(s) as
Word?
c. do the users need to be able to select the file themselves, or can the
merge document be created for them with the data source etc. already
attached?
If the merge document can be created for them, you can try the following
1. create a header file, e.g. called myheader.txt, containing:
"MDLNR","NAVN","ADRESSE1","ADRESSE2","POSTNR","BYEN"
"MDLNR","NAVN","ADRESSE1","ADRESSE2","POSTNR","BYEN"
(Yes, duplicate the line - Word generally recognises header labels more
easily if you do)
2. in Word 2003, use Tools|Customize|Commands to drag the MailMergeHelper
comand from the All Commands category to a toolbar. Check
Tools|Options|General|"Confirm conversion at open"
3. use MailMergeHelper to set up the mail merge type and select the header
source. Then go into the Open Data Source dialog (Select Data Source in Word
2002/2003. Select All files (*.*), then locate and select the DIF file. In
Word 2000/97, check the "Select method". Then, in any version of Word, you
should be asked to confirm the format. You will probably have to select the
Show All checkbox, then select the Excel files via DDE option. Excel should
start and open the DIF file.
4. If that works, save and close the mail merge main document and try
re-opening it.
I have not checked all of this, but the main elements of it work here with
Word 2003. Obviously it is not a simple process that could easily be
followed by a user, which is why I asked question (c) above. It may be
possible to automate the process using a VBA OpenDataSource call and put
that inside an AutoOpen macro. It may also be possible to open the data
source using OLEDB, which would eliminate the additional complexity of
opening Excel, but I have not checked that yet, partly because if it does
work, it can only work in Word 2002/2003.
Also, in earlier versions of Word, there was an Excel Converter which may be
able to read the file directly - if you see this option, try it. However,
this converter has been removed from the current set of Office Text file
converters so it is not a viable long-term option.
Peter Jamieson