PDA

View Full Version : Printer Menu help



phil210802
09-02-2014, 03:45 PM
I have a legacy printer menu (in with a lot of other code) that I am unable to get working in Word 2013 (the code was created in Word XP)

The printer menu seems to work without an issue, however when I click on the print button (which is associated to the below code nothing happens)

Any help would be greatly appreciated.


Private Sub cmdPrint_Click() ' Print button

Application.ScreenUpdating = False 'turns the screen updating off


On Error GoTo wrong


NumberofCopies = Val(txtNumberCopies.Text) ' number of Copies required


If NumberofCopies <= 0 Then 'error message if no copies selected
MsgBox "please enter the number of copies required", vbInformation, "COMPANY NAME"""
txtNumberCopies.SetFocus
Printer.EndDoc
Exit Sub

Thanks in advance

Phil210802

gmayor
09-02-2014, 10:16 PM
You have not included all of the relevant code, but if you comment out the On Error Goto wrong line, which is presumably causing the errant part of the code to be skipped, you might get a better insight into the problem.

macropod
09-02-2014, 10:46 PM
Graham,

This thread is a partial duplicate of http://www.vbaexpress.com/forum/showthread.php?50616-Legacy-dot-vba-to-Word-2013-docm.

This one should never have been started.

gmayor
09-02-2014, 11:06 PM
That would explain it:banghead: