#  Other Applications & Softwares  > Word Formatting & General >  >  Want to Automate Mail Merge Print with Excel VBA, and an Oddity with Automated Mail Merge

## Jenn68

I use this code in my Excel based VBA project to automate a mail merge. An Excel worksheet provides the data.




```
Please Login or Register  to view this content.
```


This code, in it's current form, works. It opens my mail merge document, merges the information based on the report's SQL string, saves the file and leaves it open in a minimized window in the taskbar.
Two questions ...

1) what do I need to add if I want to print this merged document in addition to having it simple open up to be viewed?
2) The document is in a minimized window. After maximimizing it, the user has no control of the document ... toolbar buttons don't work, unable to edit the document. You have to minimize it, then maximize it again before the document is accessible. What's up with that?

Jenn

----------


## macropod

Re 1, you need to add something as trivial as:
odoc2.Printout

----------


## Jenn68

Thank you Paul, I'll have to give it a go. I think this code is riddled with problems. See my other post http://www.excelforum.com/word-formatting-and-general/844573-mail-merge-time-suddenly-displaying-as-decimals-again.html in this forum.

----------

