#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
Lovely reply. Thank you its done. You might close the thread
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro Code for Duplex Printing | Leftovercity | Word VBA | 4 | 01-27-2017 10:43 AM |
Insufficient memory error when printing to a macro | Rockystock | Word VBA | 8 | 10-21-2016 07:43 AM |
How to change this printing macro | terrymac | Excel Programming | 1 | 12-01-2015 06:47 PM |
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 |