Word Automation - AutoNew Macro, Custom File Saves

M

MaxArk

In an effort to automate my document, and not having to depend on the
user knowing which button to press, I am wishing my merge to go
automatically to a new document?

It was suggested to put code in an AUTONEW macro in my tempate. How do
I do this? Where would I find this autonew macro? I'm lost with VB
through Word. Excel is a bit easier.

Also, how can I have the new document save automatically with a file
name based on one of the merge fields of the new document?

Jenn
 
H

Herb Tyson [MVP]

I suspect that you're going to need one of the .vba newsgroups.

The AutoNew macro doesn't exist until you create it. It is one of a number
of macro names you can give to macros that you want to run automatically at
specific times. From Word's VBA Help file:

AutoExec runs When you start Word or load a global template
AutoNew runs Each time you create a new document
AutoOpen runs Each time you open an existing document
AutoClose runs Each time you close a document
AutoExit runs When you exit Word or unload a global template

It's simply a matter of creating the desired automatic macro, then stuffing
it with the desired commands (and ensuring that it is created in the
appropriate template file).

But, I suspect that "simply" isn't quite going to do it. You might start
here:

http://word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm
 
D

Doug Robbins - Word MVP

See the "Individual Merge Letters" item on fellow MVP Graham Mayor's website
at:

http://www.gmayor.com/individual_merge_letters.htm

If you are using Word XP or later, the "Add-in to Merge Letters to Separate
Files" that I have written and that can be downloaded from that site will
allow you to create each letter as a separate file with a filename taken
from a field in the data source with a minimum of fuss.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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