I
Iain McLaren
Hi,
I have a macro in Word that helps users print to the correct printer tray.
It is basically this:
Sub print_sm(mTray As String, mCopies As Integer)
Options.DefaultTray = mTray
ActiveDocument.PageSetup.FirstPageTray = wdPrinterDefaultBin
ActiveDocument.PageSetup.OtherPagesTray = wdPrinterDefaultBin
For mI = 1 To mCopies
Application.PrintOut Range:=wdPrintAllDocument
Next
End Sub
It worked fine in Word 97, but in 2003 it's rather intermittent. It's as if
the Options.DefaultTray isn't taking sometimes. If I set a breakpoint at the
FirstPageTray line and query the value of Options.DefaultTray, it isn't
always what it should be.
Is there a known reason why this might be? Could I do a workaround along the
lines of:
count=0
while (Options.DefaultTray<>mTray) and (count<100)
Options.DefaultTray=mTray
doevents
count=count+1
wend
Any suggestions gratefully received.
Cheers,
Iain
I have a macro in Word that helps users print to the correct printer tray.
It is basically this:
Sub print_sm(mTray As String, mCopies As Integer)
Options.DefaultTray = mTray
ActiveDocument.PageSetup.FirstPageTray = wdPrinterDefaultBin
ActiveDocument.PageSetup.OtherPagesTray = wdPrinterDefaultBin
For mI = 1 To mCopies
Application.PrintOut Range:=wdPrintAllDocument
Next
End Sub
It worked fine in Word 97, but in 2003 it's rather intermittent. It's as if
the Options.DefaultTray isn't taking sometimes. If I set a breakpoint at the
FirstPageTray line and query the value of Options.DefaultTray, it isn't
always what it should be.
Is there a known reason why this might be? Could I do a workaround along the
lines of:
count=0
while (Options.DefaultTray<>mTray) and (count<100)
Options.DefaultTray=mTray
doevents
count=count+1
wend
Any suggestions gratefully received.
Cheers,
Iain