VBA Printing Problem

M

MorpheusX

Hello all,

because we have multiple printers , we have created a macro which is
assigned to a button in the toolbar to directly print to a printer. this is
easy because we don't have to go to file, print and then select a printer.
The only thing that happens is that MS Word is no longer responding. I will
post the code here can anyone help me.

code:

Sub secprint()

ActivePrinter = "pdf"
Application.PrintOut Range:=wdPrintAllDocument,
Item:=wdPrintDocumentContent, Copies:=1

End Sub
 
M

MorpheusX

Dear Graham,

I did use your first code and still the same problem. But I just some other
code of your site which did work.

Sub HPPrintDialog()
Dim sPrinter As String
With Dialogs(wdDialogFilePrintSetup)
sPrinter = .Printer
.Printer = "HP LaserJet 4050 Series PS"
.DoNotSetAsSysDefault = True
.Execute
Dialogs(wdDialogFilePrint).Show -------> changed this in Execute
.Printer = sPrinter
.DoNotSetAsSysDefault = True
.Execute
End With
End Sub

I still think it is strange that your first code at your site did not work,
but now it is working. Do you now how it is possible why the other code isn't
working i'm still interested in that one.

Thank you for your help.
 

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