by Debra Wyatt
(last updated January 12, 2022)
Macros really can make life easier. It is not uncommon to create macros that perform repetitive tasks, and thereby relieve us of the mundane tasks we might otherwise need to perform. It is also not uncommon to need to print out the current document after doing some processing on it. If you find yourself with this need, you can simply let the macro take care of printing the current document. To add this capability to your macros, simply include a line like this:
The PrintOut method prints the specified document; in this case, the ActiveDocument object—the document currently selected—is printed. In this particular usage, the Copies argument is used to specify how many copies of the document to print.
When using the PrintOut method, there are quite a few different arguments you can use. Rather than detail all of them, it is probably more useful to just look at some of the more common arguments you can use.
|Copies||The number of copies to print.|
|Pages||The page ranges to print. The ranges are separated by commas and enclosed in quote marks, similar to how you specify page ranges in the Print dialog box.|
|PrintToFile||Normally False, but you can set it to True if you want output to go to a disk file instead of the printer.|
|OutputFileName||Only necessary if you set PrintToFile to True. Used to specify the file name of the output file.|
Growing your own fruit, vegetables, and flowers can be loads of fun and a very satisfying project. It is even more ...Discover More
House plants are a wonderful way to bring the beauty of the natural world into our homes. If you would like to be able to ...Discover More
There are all kinds of problems that you could potentially have with your soil, one of the more interesting ones is to ...Discover More
FREE SERVICE: Receive an e-mail several times each week with a featured gardening tip. Enter your address and click "Subscribe."