Hi Cindy,
Thanks for replying. I will post with more info
when I get into work, but (from memory), the gist of the
situation is this:
I am writing an Access/SQL Server .adp database system and
need to incorporate a way to allow users to select and
open both spreadsheets and mailmerge word documents that
are populated with selected data.
The solution I am exploring involves creating a file DSN,
and a .dqy query file. I use these to provide data to an
excel spreadsheet. If the user just wanted a spreadsheet
that's the end of it, and my Access application opens the
spreadsheet. If the user wants a mailmerge document the
word file is opened. This uses the spreadsheet as a
datasource.
I found what appeared to be a nice situation for the
spreadsheet file in that the Aut
pen macro is used to
set the datasource to the .dqy file, so if security is
high this macro does not run(as expected) on manual
openning, but I can programatically open the xls file and
call the macro in code. This has the effect that the
spreadsheet will fill with data only when opened by the
application.(Even with high security)
Other solutions I have come across require me to reduce
the security settings to either low: (Always run macros)
or medium (prompt the user). Neither of these are very
good;
1 Whats the point of having security if it always has to
be set to low to get things to work!?
2 Prompting a user who is not an IT expert causes them to
panic, press the wrong buttons, and generally get upset.
OK, the above solution appears to work for spreadsheets,
but for a word mail merge that uses the xls file as its
datasource it can't circumvent the security.
The mailmerge is handling the link to the xls file and
cannot do it correctly. What I would like to do is to call
the mailmerge in code to get it to open, or somehow have
it trust the word document so that it will still open. I
don't know if there is any way to accomplish this??
Thanks
Chris