Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / May 2004

Tip: Looking for answers? Try searching our database.

Help with mail merging using a Text File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steven Moschidis - 20 May 2004 14:46 GMT
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
Cindy M  -WordMVP- - 21 May 2004 15:26 GMT
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 :-)
Steven Moschidis - 24 May 2004 10:41 GMT
Hi Cindy,
Thank you for your reply!

Cindy M -WordMVP- wrote:
> Hi Steven,
>
[quoted text clipped - 3 lines]
>
> 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
[quoted text clipped - 3 lines]
> 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
[quoted text clipped - 3 lines]
> 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
Cindy M  -WordMVP- - 24 May 2004 15:38 GMT
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?

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

> > 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...

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 :-)
Steven Moschidis - 24 May 2004 17:22 GMT
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

Cindy M -WordMVP- wrote:
> Hi Steven,
>
[quoted text clipped - 6 lines]
>
>     Wd97 AND "mail merge" AND delimiter

>>>What should work is to duplicate the field names in the header source file
>>>(just copy/paste).
[quoted text clipped - 16 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
Cindy M  -WordMVP- - 25 May 2004 14:51 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.