J
Jacek
Hello,
I use Word 2000 and I call its mail merge from Visual C++. It is simply a DLL library, which calls directly the Word object which makes the mail merge, and I in my program call this DLL library.
I have header file and data source file as txt files, with delimiters "new line" between fields and "|" at the end of record. I have only one record in data source file.
It works, when I call Word before and fix the directories for header file and data source file from Word's menu "Mail merge" - then I fix also which delimiters should it use.
But when I call the function OpenDataSource in the DLL library (it means, that I want in the future to control the printing by choosing not always only one data source file, but just different ones):
mailMerge.OpenDataSource("d:\\datasource.txt", COleVariant((long) 4), vtFalse, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt);
then it doesn't work correctly, because it calls the default Word dialog which asks about the delimiters.
How can I skip this dialog? It is very important to skip it, since I want to make it fully automatic, without any user action. Is there for example a function which sets the delimiters (but without calling the dialog) before I call OpenDataSource?
Thank you in advance,
Jacek.
I use Word 2000 and I call its mail merge from Visual C++. It is simply a DLL library, which calls directly the Word object which makes the mail merge, and I in my program call this DLL library.
I have header file and data source file as txt files, with delimiters "new line" between fields and "|" at the end of record. I have only one record in data source file.
It works, when I call Word before and fix the directories for header file and data source file from Word's menu "Mail merge" - then I fix also which delimiters should it use.
But when I call the function OpenDataSource in the DLL library (it means, that I want in the future to control the printing by choosing not always only one data source file, but just different ones):
mailMerge.OpenDataSource("d:\\datasource.txt", COleVariant((long) 4), vtFalse, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt);
then it doesn't work correctly, because it calls the default Word dialog which asks about the delimiters.
How can I skip this dialog? It is very important to skip it, since I want to make it fully automatic, without any user action. Is there for example a function which sets the delimiters (but without calling the dialog) before I call OpenDataSource?
Thank you in advance,
Jacek.