Help with mail merging using a Text File

S

Steven Moschidis

Hi,
I am working on a web based application, which is supposed to do mail
merge amongst other things.
All the processing is done on the back end using Visual Basic dlls.
This means that the mail merge process has to be fully automated as well.
Here is an outline of the system:
a word document which is set up as a mail merge document
a text file containing the headers of the fields (since the actual data
is generated on the fly upon a user's request)
a text file which is generated when a user makes a request for a letter

both of the text files use a tab as the field delimiter and the new line
combination (13 and 10 i think) as the record delimiter

my problem is that sometimes (for example when there is only one record
in the text file) a little dialog box pops up asking me to specify the
delimiters even though its already got the correct ones in...
As you can understand this defeats the point of the application being
automatic.
i have gone through msdn library and tried several other sources but i
cannot find anywhere that specifies how to manipulate that dialog box
programmatically (either click yes/ok or suppress/ignore it)
I have also tried some of the typical workarounds such as saving the
text file using a different extension and I have also checked the
registry entries under the text datasource of the Jet engine.

I would IMMENSELY appreciate your help in this!

Kind Regards,
Steven C Moschidis MBCS
 
C

Cindy M -WordMVP-

Hi Steven,
my problem is that sometimes (for example when there is only one record
in the text file) a little dialog box pops up asking me to specify the
delimiters even though its already got the correct ones in...
There's a somewhat obscure Knowledge Base article on this problem. What it
basically comes down to is that Word wants to do its job really well, so
it wants a "pattern confirmation" that the field delimiter it's guessing
is actually the one to use. Since one record + header source isn't enough
for that, the dialog box displays.

What should work is to duplicate the field names in the header source file
(just copy/paste).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
S

Steven Moschidis

Hi Cindy,
Thank you for your reply!

Hi Steven,



There's a somewhat obscure Knowledge Base article on this problem. What it

could you please forward a link for this KB article?
basically comes down to is that Word wants to do its job really well, so
it wants a "pattern confirmation" that the field delimiter it's guessing
is actually the one to use. Since one record + header source isn't enough
for that, the dialog box displays.

What should work is to duplicate the field names in the header source file
(just copy/paste).
I have tried this and I am afraid it doesnt work... (I tried with
triplicate as well...)

The single record result sets still require me to click on ok and some
multiple record result sets pause until I verify the delimiters (I still
have not been able to figure out the pattern for the multiple record
result sets)

As you can understand even if the suggested solution worked I would
still be looking for a way to handle that specific dialog in case it
showed up in the future when the system is out of testing...

I would really appreciate any further thoughts you might have on this.
What really puzzles me is the fact that there is no apparent way to
programmatically manipulate the dialog (if im missing something please
correct me!!!)
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)


This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)


Thank you for your help and time!

Kind Regards,
Steven C Moschidis MBCS
 
C

Cindy M -WordMVP-

Hi Steven,
could you please forward a link for this KB article?
I don't have it at hand, but you should be able to turn it up by searching the
Knowledge Base at microsoft.com or through Google. Try something like

Wd97 AND "mail merge" AND delimiter
I have tried this and I am afraid it doesnt work...
Then I'm afraid you're going to be in very big trouble...

There's another Knowledge Base article, written for automating Office from VB,
that describes how to (with luck) close messages that are waiting for user
input. I'd try searching for that with something like

VB AND Off2000 AND dismiss AND message

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
S

Steven Moschidis

Dear Cindy,
I am eternally grateful for your help.
It turns out that the search you suggested (VB AND Off2000 AND dismiss
AND message ) returned a KB article that deals specifically with this
type of problem. (for the benefit of others having the same problem: the
KB article suggests using a Timer event at the point where a dialog
might appear and simulate user input using the SendKeys function)
(http://msdn.microsoft.com/library/en-us/dnoffdev/html/vsofficedev.asp?frame=true)


It looks like I will not have to redesign everything to make it work...!
Thank you so much for your help!

Kind Regards,
Steven C Moschidis MBCS
 
C

Cindy M -WordMVP-

Hi Steven,
It turns out that the search you suggested (VB AND Off2000 AND dismiss
AND message ) returned a KB article that deals specifically with this
type of problem.
Glad the old grey cells are still good for something :), and that you're
up and running!

Cindy Meister
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top