Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2020, 02:38 AM
LooKLooK LooKLooK is offline Macro for printing Windows 7 32bit Macro for printing Office 2013
Novice
Macro for printing
 
Join Date: Sep 2020
Posts: 2
LooKLooK is on a distinguished road
Default Macro for printing

Hi there everyone, i would like to ask your help on this matter.



I want to print one document in triplicate, like an invoice that in some part of document it automatically change the word 'original' to 'duplicate' in second print and in third print it changes to triplicate.

Can anyone help me with this? Thanks in advance.
Reply With Quote
  #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,101
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 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
  #3  
Old 09-10-2020, 04:15 AM
LooKLooK LooKLooK is offline Macro for printing Windows 7 32bit Macro for printing Office 2013
Novice
Macro for printing
 
Join Date: Sep 2020
Posts: 2
LooKLooK is on a distinguished road
Default

Lovely reply. Thank you its done. You might close the thread
Reply With Quote
Reply

Thread Tools
Display Modes


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:02 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