View Single Post
 
Old 11-08-2011, 03:13 AM
HorizonSC HorizonSC is offline Windows Vista Office 2003
Novice
 
Join Date: Sep 2011
Posts: 5
HorizonSC is on a distinguished road
Default VBA Print Command Prints Document Twice

Hi all, I wrote some very simple VBA code to call up the print dialogue when a command button within the document is clicked. The dialogue code is as below:
Code:
Sub Display_Print_Dialog_CustomAll()
     With Dialogs(wdDialogFilePrint)
         .Range = wdPrintRangeOfPages
         .Pages = "2-8"
          If .Show = -1 Then .Execute
     End With
 End Sub
and then the command button code:
Code:
Private Sub CommandButton09_Click()
   Display_Print_Dialog_CustomAll
End Sub
However, when the button is clicked, the print dialogue comes up only once, and with only the correctly specified number of copies (1), yet sends the job to the printer twice. I have checked to ensure no copies of the macro exist within the normal template, and also that there are no function with the same name - However, I'm at a complete loss as to go about solving the issue since I've only learned VBA in the last month or so.

Hope someone can offer some advice, and thanks in advance,
Reply With Quote