Mail Merge Events

S

Sara

I have code in an .ade file to determine whether the file
is being opened by the user directly or by another
application. The purpose being that I don't want other
applications accessing my file. I have tested it and it
works - displays the proper message when I open the file
versus when my VB project opens the file. I want the
message to also display when Word tries to use the .ade
file as a datasource (I don't want this to be allowed!).
But, no message appears :( Does Word not actually open the
file, but somehow just grabs the connection information?
Any help would be much appreciated.

Thanks,
Sara
 
C

Cindy Meister -WordMVP-

Hi Sara,
I want the
message to also display when Word tries to use the .ade
file as a datasource (I don't want this to be allowed!).
But, no message appears :( Does Word not actually open the
file, but somehow just grabs the connection information?
Word probably does open the file, in memory. And I suspect it
opens data source files in such as way as to make sure
macro/VBA code won't run. But it would only open the file
into the Word application UI if the user requested to "view"
the data source using the older Word mail merge tools (that
aren't in the user interface by default).

Is your *.ade file a Word table or delimited text file, then?
Otherwise, I can't imagine it could work as a data source...
Perhaps you need to save it in a - for mail merge -
unreadable format (maybe hidden?) and have your VBA code only
"unhide" it if it's opened the way you want it to be opened.

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

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

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