J
Jules
I have a macro set up whereby users are presented with a user form which
gives them the choice of printing all pages, current page or first page OR
inserting into a text box which pages they wish to print. The form also has
a combo box for selecting/inserting the number of copies they wish to print.
Here is the code for the cmdOK button of the form
dim Specific Pages as String
dim NumberCopies as String
SpecificPages = txtSpecPages.value (the name of the text box)
NumberCopies = cboNumCopies.value (the name of the combo box)
If SpecificPages <> "" Then
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages,
Pages:=SpecificPages, Copies:=NumberCopies
ElseIf OptA = True Then (the option button for printing all pages)
ActiveDocument.PrintOut Copies:=NumberCopies
ElseIf OptC = True Then (the option button for printing the current page)
ActiveDocument.PrintOut Range:=wdPrintCurrentPage,
Copies:=NumberCopies
ElseIf OptF = True Then (the option button for printing the first page)
Selection.HomeKey Unit:=wdStory
ActiveDocument.PrintOut Range:=wdPrintCurrentPage,
Copies:=NumberCopies
End If
What happens is the following:
If specific pages is filled in - prints all pages and prints one copy
regardless of how many copies are asked for
If Print All - prints all pages (which is OK) but only prints one copy
regardless of how many copies are asked for
Print Current - prints all pages and only prints one copy regardless of how
many copies are asked for
Print First - prints all pages and only prints one copy regardless of how
may copies are asked for
What am I doing wrong????
The printer I am printing to is set up to print duplex at all times, does
this conflict with the printing request? I would have thought that it would
still print the pages you asked for as duplex.
thanks,
gives them the choice of printing all pages, current page or first page OR
inserting into a text box which pages they wish to print. The form also has
a combo box for selecting/inserting the number of copies they wish to print.
Here is the code for the cmdOK button of the form
dim Specific Pages as String
dim NumberCopies as String
SpecificPages = txtSpecPages.value (the name of the text box)
NumberCopies = cboNumCopies.value (the name of the combo box)
If SpecificPages <> "" Then
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages,
Pages:=SpecificPages, Copies:=NumberCopies
ElseIf OptA = True Then (the option button for printing all pages)
ActiveDocument.PrintOut Copies:=NumberCopies
ElseIf OptC = True Then (the option button for printing the current page)
ActiveDocument.PrintOut Range:=wdPrintCurrentPage,
Copies:=NumberCopies
ElseIf OptF = True Then (the option button for printing the first page)
Selection.HomeKey Unit:=wdStory
ActiveDocument.PrintOut Range:=wdPrintCurrentPage,
Copies:=NumberCopies
End If
What happens is the following:
If specific pages is filled in - prints all pages and prints one copy
regardless of how many copies are asked for
If Print All - prints all pages (which is OK) but only prints one copy
regardless of how many copies are asked for
Print Current - prints all pages and only prints one copy regardless of how
many copies are asked for
Print First - prints all pages and only prints one copy regardless of how
may copies are asked for
What am I doing wrong????
The printer I am printing to is set up to print duplex at all times, does
this conflict with the printing request? I would have thought that it would
still print the pages you asked for as duplex.
thanks,