#1
|
|||
|
|||
Macro Code for Duplex Printing
Hi Everyone,
First time on here. I'm new to Macros but got one working that creates sequential numbering page to page. But now my issues is that the document I need it for is two pages and I need it to be printed two sided (Duplex). When I run the Macro it bypasses the printer setting window and prints two individual pages. Is there a Macro code I can add to run duplex printing? Here's my current code: Code:
Dim Message As String, Title As String, Default As String, NumCopies As Long Dim Rng1 As Range ' Set prompt. Message = "Enter the number of copies that you want to print" ' Set title. Title = "Print" ' Set default. Default = "1" ' Display message, title, and default value. NumCopies = Val(InputBox(Message, Title, Default)) SerialNumber = System.PrivateProfileString("C:\Settings.Txt", _ "MacroSettings", "SerialNumber") If SerialNumber = "" Then SerialNumber = 1 End If Set Rng1 = ActiveDocument.Bookmarks("SerialNumber").Range Counter = 0 While Counter < NumCopies Rng1.Delete Rng1.Text = Format(SerialNumber, "0000") ActiveDocument.PrintOut SerialNumber = SerialNumber + 1 Counter = Counter + 1 Wend 'Save the next number back to the Settings.txt file ready for the next use. System.PrivateProfileString("C:\Settings.txt", "MacroSettings", _ "SerialNumber") = SerialNumber 'Recreate the bookmark ready for the next use. With ActiveDocument.Bookmarks .Add Name:="SerialNumber", Range:=Rng1 End With ActiveDocument.Save Last edited by macropod; 01-26-2017 at 03:54 PM. Reason: Added code tags and formatting |
Tags |
duplex, macro edit |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Stop duplex printing | NuDawn | Word | 0 | 12-28-2016 09:06 AM |
Mixed Duplex Printing | jaygreg | Word | 2 | 01-29-2014 09:54 AM |
Printing calendar pages with duplex | cma6 | Outlook | 0 | 12-06-2012 07:29 AM |
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 |