I know there are a few of you here who are good with various types of code.
I've searched all day on the net and can't work out what I'm doing wrong.
Basically I have a tonne of large documents to print. I can't print them all in one go because the printer shit itself when it gets hot.
I want create a simple .bat file that will open word, open a document, run a macro I've made, close word.
The Macro prints 5 copies to an non-defult printer.
The idea is that I can schedule XP to run the bat file once an hour over night, should give the printer about half an hour printing, half an hour cooling and it hopefully wont fuck up.
Here is my bat file
Code: Select all
"C:\Program Files\Microsoft Office\OFFICE11\windword.exe"
"F:\Threatened Species & Ecosystem\Prioritising Species\NRM Regional Workshops\Burdekin Dry Tropics\Biodiversity Action Plan\DRAFT for REVIEW\NQDT Biodiversity Action Plan_DRAFT 25 May 09 .doc" /mPrintFiveCopiesOn32 /mFileClose
my macro is named 'PrintFiveCopiesOn32'
here is the macro
Code: Select all
Sub PrintFiveCopiesOn32()
'
' PrintFiveCopies Macro
' Macro created 27/05/2009 by David Thomas Phillips
'
ActivePrinter = "\\BNEFP02\ANN_152.32"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=5, Pages:="", PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Sub
The macro works from within word, but not from command prompt.
Word does open from command prompt, but then it just sits there macro-less.
What am I doing wrong?!