found solution (sort of)

  • Thread starter Thread starter Cindy
  • Start date Start date
C

Cindy

I set the word document up as a template (.dot)
then on my access form I created a command button and
made it invisible then...

dim odoc as commandbutton
set odoc = me.command0
with odoc
.Hyperlinkaddress("Path and file name")
.hyperlink.follow
end with

This open the word template. On the open event of the
template I added a macro...

me.mailmerge.execute
me.close

this merges then closes the doc.

I have only one more thing

when it opens the doc it asks to enable macros - can I do
that in code?
 
sorry ment to post a reply on my previous message. This
is about a merge from access table to a word document.
 
The "enable macros" message is raised by Word's macro security check.
You can't disable it from code - or it would be a bonanza for virus
writers. Depending on your version of Word you can disable the macro
warning (for all documents), set security to low, or self-certify the
code in this template.

ALternatively, it's possible to do this without having any code in the
template, with code running in Access to launch Word, open the template
and execute the mailmerge.
 
Back
Top