Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-05-2020, 04:29 AM
alex100 alex100 is offline Manual duplex printing script Windows 7 64bit Manual duplex printing script Office 2016
Advanced Beginner
Manual duplex printing script
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default Manual duplex printing script

I wrote a small script that will print out a document in manual duplex mode. Yes, I know MS Word already has an option for this (Manually Print on Both Sides), but I could not use that option unless I would have to reorder (reverse) the second set of pages. I'm referring to the one that needs to be flipped over.

The script below prints out all the pages in the exact order they need to be printed. The only problem is that the 'Application.PrintOut' instruction won't print the first set of pages, unless the script has been fully executed. During this time they will have a 'Spooling' status in the print queue, waiting for the script to end.



What I need it to do, is...

1) print out the first set of pages;
2) present the dialog box informing me to flip over the pages, and wait for me to press the 'Ok' button;
3) then finally, print out the second set of pages.

Any thoughts on how I could make the script work this way...?

Right now, the whole printing process will only start AFTER pressing the 'flip over' ok button.

The maximum number of prints is limited to 10, but that can be easily changed. I'd like to mention that I have no experience in VBA, although this is not my first script.

Thank you,
Alex

Code:
Dim start_page As Integer
Dim end_page As Integer

start_page = InputBox("Start page:", "Print", "1")

document_pages = ActiveDocument.Range.Information(wdNumberOfPagesInDocument)

end_page = InputBox("End page:", "Print", document_pages)

print_order = Array("1", "3", "5", "7", "9", "10", "8", "6", "4", "2")

For Each current_print In print_order
    If current_print >= start_page And current_print <= end_page Then
        difference = current_print - previous_print
        If difference = 1 And previous_print >= 1 Then
            MsgBox ("Please remove and flip over the paper stack...")
        End If
        Application.PrintOut Background:=True, FileName:="", Copies:=1, Range:=wdPrintRangeOfPages, Pages:=current_print
        previous_print = current_print
    End If
 Next
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplex printing in Publisher Ellymoo Publisher 0 02-19-2019 04:13 AM
Stop duplex printing NuDawn Word 0 12-28-2016 09:06 AM
Manual duplex printing script Mixed Duplex Printing jaygreg Word 2 01-29-2014 09:54 AM
Manual duplex printing script Duplex printing fireman0174 Word 1 09-26-2011 01:44 AM
Duplex Printing a merge doc AshlandMark Word 0 02-10-2009 12:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft