Printing Current Page problem

A

Addy

Please can anyone tell me why the below does not work.

Many thanks

Private Sub CBOXCURRENTPLAIN_Click()

If CBOXCURRENTPLAIN.Value = True Then


With Dialogs(wdDialogFilePrintSetup)
.Printer = "\\rother\CanonMF13"
.DoNotSetAsSysDefault = True
.Execute

ActiveDocument.PrintOut Range:=wdPrintCurrentPage
End With

End If
End Sub
 
D

Doug Robbins - Word MVP

Move the End With to before the ActiveDocument.PrintOut and it should work.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

Addy

Many thanks but I've already tried that and it still doesn't work - any more
ideas?

cheers
 
D

Doug Robbins - Word MVP

Try without the With - End With part.

Does the document then print to the default printer? If so, there's a
problem with your reference to the printer.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

Addy

It won't work taking the with end with out. Its supposed to print to our
photocopier but I want it then to revert back to the default laser printer.
The printer code works on all my other macros fine. I found that bit of code
yesterday before that I tried

ActivePrinter = "\\rother\lex1340"
Else
ActivePrinter = "\\rother\lex1435"

as we have 2 printers in our dept but that only defaulted to the lex1340 and
wouldn't default to the 1435 for the people that use that printer. The new
code also seems to have quicked up the macros.

Would you believe it its working now. Just tried it again but with just
plain text and its working. I think it could have been the document I was
using as it had loads of field codes, cross ref and comments in it.

Thanks for your help anyway

Addy
 

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