Start a mail merge upon opening the document

Joined
Aug 21, 2020
Messages
2
Reaction score
1
I've created a template that makes extensive use of merge fields for automation. It uses a lot of { SET Name { FILLIN "What is your name?" } } type of syntax, and then references, in this example, { Name } elsewhere in the document. Works beautifully, except that I have to start the process by selecting everything (Ctrl A), and then hitting F9.

For me, that's no big deal, but I'd like to provide it for several other people who... let's just say it'd be a lot easier if I could just have the document come up and auto-start the merge process.

What I thought might work was setting up the AutoNew() macro, then doing:
ActiveDocument.Range.Select
ActiveDocument.MailMerge.Execute


But it doesn't like that. It says that it's not a merge main document. I'm not sure why, given that it has a whole lot of merge fields in it.

Alternatively, is there a way to just select the whole document and then keypress F9?

Anyway, that's what I'm trying to do. Any help would be appreciated.
 
Joined
Aug 21, 2020
Messages
2
Reaction score
1
Never mind. I figured it out myself. Easier than I thought.

Sub AutoOpen()
Selection.WholeStory
Selection.Fields.Update
End Sub


That's it.
 

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