Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-10-2020, 03:55 AM
gmayor's Avatar
gmayor gmayor is offline Macro for printing Windows 10 Macro for printing Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Bookmark the location where you want the changed text with the bookmark name "CopyNum" Then run the following macro


Code:
Sub PrintTriplicate()
'Graham Mayor - https://www.gmayor.com - Last updated - 10 Sep 2020
Dim oRng As Range
Dim Counter As Long
    If ActiveDocument.Bookmarks.Exists("CopyNum") = False Then
        MsgBox "The bookmark 'CopyNum' is missing from the current document.", vbCritical
        GoTo lbl_Exit
    End If
    Set oRng = ActiveDocument.Bookmarks("CopyNum").Range
    For Counter = 1 To 3
        Select Case Counter
            Case 1
                oRng.Text = "Original"
            Case 2
                oRng.Text = "Duplicate"
            Case 3
                oRng.Text = "Triplicate"
        End Select
        ActiveDocument.PrintOut
        oRng.Bookmarks.Add "CopyNum"
    Next
lbl_Exit:
    Set oRng = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for printing Macro Code for Duplex Printing Leftovercity Word VBA 4 01-27-2017 10:43 AM
Macro for printing Insufficient memory error when printing to a macro Rockystock Word VBA 8 10-21-2016 07:43 AM
Macro for printing How to change this printing macro terrymac Excel Programming 1 12-01-2015 06:47 PM
Macro for printing Hide Macro Button when printing Eduardo Care Word VBA 6 11-09-2015 04:19 PM
Printing Macro citsltd Word VBA 4 07-13-2015 02:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:18 PM.


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