Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages?
I would like to print 1000 receipts using Word or Excel but dont want to
create that number of pages. Is there any shorter way to do it? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages?
Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Something like labels. It is like I want to create a form that has its own
serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
I think what Graham was saying was that "labels" are the way to do it. See
http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Yes, I was suggesting that labels are (one way) to do this. You could do it
also with a catalog/directory mail merge, but a label merge is the most logical way of putting several similar documents on a page - see also http://www.gmayor.com/mail_merge_lab...th_word_xp.htm or http://www.gmayor.com/merge_labels_with_word_2007.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Hmm, I am new to merging. But from examples given, it seem to capture data
from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
If all the receipts contain exactly the same data apart from the
incrementing number then the Excel method shown on the linked page http://www.gmayor.com/Numbered_labels.htm will do the job. See also http://www.gmayor.com/automatic_numbering_documents.htm If you want to avoid mail merge altogether, then you can do so with a macro. The following is a minor variation on one I posted some time ago The numbers are stored in a text file "Settings.ini" which is saved for convenience in the Word Startup folder (though you can use another path if you prefer. The macro reads the next number from the ini file, types it in the bookmarked cell then prints the document. The number is then incremented by one and the process repeated as many times as you request certificates from the input box. Finally the next number is written to the ini file for next time. I have added a macro to reset the number should that be required. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As Integer Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Reciepts", 1) 'Save invoice number in the Word startup folder. SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount With Selection .GoTo What:=wdGoToBookmark, _ name:="RecNo" .TypeText Text:=Format(Order, "00000") End With ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset Receipt Number?", "Reset", Order) Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order - 1 End Sub http://www.gmayor.com/installing_macro.htm Put a bookmark named "RecNo" on the receipt document where you want the number to appear and run the macro to print as many incremented receipts as you require. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hmm, I am new to merging. But from examples given, it seem to capture data from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Thanks, Graham. I will try it out.
"Graham Mayor" wrote: If all the receipts contain exactly the same data apart from the incrementing number then the Excel method shown on the linked page http://www.gmayor.com/Numbered_labels.htm will do the job. See also http://www.gmayor.com/automatic_numbering_documents.htm If you want to avoid mail merge altogether, then you can do so with a macro. The following is a minor variation on one I posted some time ago The numbers are stored in a text file "Settings.ini" which is saved for convenience in the Word Startup folder (though you can use another path if you prefer. The macro reads the next number from the ini file, types it in the bookmarked cell then prints the document. The number is then incremented by one and the process repeated as many times as you request certificates from the input box. Finally the next number is written to the ini file for next time. I have added a macro to reset the number should that be required. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As Integer Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Reciepts", 1) 'Save invoice number in the Word startup folder. SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount With Selection .GoTo What:=wdGoToBookmark, _ name:="RecNo" .TypeText Text:=Format(Order, "00000") End With ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset Receipt Number?", "Reset", Order) Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order - 1 End Sub http://www.gmayor.com/installing_macro.htm Put a bookmark named "RecNo" on the receipt document where you want the number to appear and run the macro to print as many incremented receipts as you require. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hmm, I am new to merging. But from examples given, it seem to capture data from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Thanks, Graham. I tried the macro method. However when I print it, all the
serial numbers will appear one after another. Meaning, at page 2 it will print 0000100002 and page 3 will appear 00001000020003 and so forth. How do I avoid that? "Graham Mayor" wrote: If all the receipts contain exactly the same data apart from the incrementing number then the Excel method shown on the linked page http://www.gmayor.com/Numbered_labels.htm will do the job. See also http://www.gmayor.com/automatic_numbering_documents.htm If you want to avoid mail merge altogether, then you can do so with a macro. The following is a minor variation on one I posted some time ago The numbers are stored in a text file "Settings.ini" which is saved for convenience in the Word Startup folder (though you can use another path if you prefer. The macro reads the next number from the ini file, types it in the bookmarked cell then prints the document. The number is then incremented by one and the process repeated as many times as you request certificates from the input box. Finally the next number is written to the ini file for next time. I have added a macro to reset the number should that be required. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As Integer Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Reciepts", 1) 'Save invoice number in the Word startup folder. SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount With Selection .GoTo What:=wdGoToBookmark, _ name:="RecNo" .TypeText Text:=Format(Order, "00000") End With ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset Receipt Number?", "Reset", Order) Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order - 1 End Sub http://www.gmayor.com/installing_macro.htm Put a bookmark named "RecNo" on the receipt document where you want the number to appear and run the macro to print as many incremented receipts as you require. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hmm, I am new to merging. But from examples given, it seem to capture data from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#10
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
That's what comes of answering without checking the code - sorry. Try the
following instead. These versions have been checked It still needs a bookmark RecNo where the number is to appear, but it will update the bookmark rather than simply add to it. The second macro sets the start number to be used. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As String Dim rRecNo As Range Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Receipts", 1) If iCount = "" Then Exit Sub SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount Set rRecNo = ActiveDocument.Bookmarks("RecNo").Range rRecNo.Text = Format(Order, "00000") ActiveDocument.Bookmarks.Add "RecNo", rRecNo ' ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset receipt start number?", "Reset", Order) If sQuery = "" Then Exit Sub Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Thanks, Graham. I tried the macro method. However when I print it, all the serial numbers will appear one after another. Meaning, at page 2 it will print 0000100002 and page 3 will appear 00001000020003 and so forth. How do I avoid that? "Graham Mayor" wrote: If all the receipts contain exactly the same data apart from the incrementing number then the Excel method shown on the linked page http://www.gmayor.com/Numbered_labels.htm will do the job. See also http://www.gmayor.com/automatic_numbering_documents.htm If you want to avoid mail merge altogether, then you can do so with a macro. The following is a minor variation on one I posted some time ago The numbers are stored in a text file "Settings.ini" which is saved for convenience in the Word Startup folder (though you can use another path if you prefer. The macro reads the next number from the ini file, types it in the bookmarked cell then prints the document. The number is then incremented by one and the process repeated as many times as you request certificates from the input box. Finally the next number is written to the ini file for next time. I have added a macro to reset the number should that be required. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As Integer Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Reciepts", 1) 'Save invoice number in the Word startup folder. SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount With Selection .GoTo What:=wdGoToBookmark, _ name:="RecNo" .TypeText Text:=Format(Order, "00000") End With ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset Receipt Number?", "Reset", Order) Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order - 1 End Sub http://www.gmayor.com/installing_macro.htm Put a bookmark named "RecNo" on the receipt document where you want the number to appear and run the macro to print as many incremented receipts as you require. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hmm, I am new to merging. But from examples given, it seem to capture data from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#11
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Graham Mayor wrote:
' ActiveDocument.PrintOut Oops - You had better remove the apostrophe from the start of the line above (used while testing) or it won't print ) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Thanks, Graham. I tried the macro method. However when I print it, all the serial numbers will appear one after another. Meaning, at page 2 it will print 0000100002 and page 3 will appear 00001000020003 and so forth. How do I avoid that? "Graham Mayor" wrote: If all the receipts contain exactly the same data apart from the incrementing number then the Excel method shown on the linked page http://www.gmayor.com/Numbered_labels.htm will do the job. See also http://www.gmayor.com/automatic_numbering_documents.htm If you want to avoid mail merge altogether, then you can do so with a macro. The following is a minor variation on one I posted some time ago The numbers are stored in a text file "Settings.ini" which is saved for convenience in the Word Startup folder (though you can use another path if you prefer. The macro reads the next number from the ini file, types it in the bookmarked cell then prints the document. The number is then incremented by one and the process repeated as many times as you request certificates from the input box. Finally the next number is written to the ini file for next time. I have added a macro to reset the number should that be required. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As Integer Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Reciepts", 1) 'Save invoice number in the Word startup folder. SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount With Selection .GoTo What:=wdGoToBookmark, _ name:="RecNo" .TypeText Text:=Format(Order, "00000") End With ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset Receipt Number?", "Reset", Order) Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order - 1 End Sub http://www.gmayor.com/installing_macro.htm Put a bookmark named "RecNo" on the receipt document where you want the number to appear and run the macro to print as many incremented receipts as you require. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hmm, I am new to merging. But from examples given, it seem to capture data from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#12
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Thanks very much, Graham. It works like a charm.
"Graham Mayor" wrote: Graham Mayor wrote: ' ActiveDocument.PrintOut Oops - You had better remove the apostrophe from the start of the line above (used while testing) or it won't print ) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Thanks, Graham. I tried the macro method. However when I print it, all the serial numbers will appear one after another. Meaning, at page 2 it will print 0000100002 and page 3 will appear 00001000020003 and so forth. How do I avoid that? "Graham Mayor" wrote: If all the receipts contain exactly the same data apart from the incrementing number then the Excel method shown on the linked page http://www.gmayor.com/Numbered_labels.htm will do the job. See also http://www.gmayor.com/automatic_numbering_documents.htm If you want to avoid mail merge altogether, then you can do so with a macro. The following is a minor variation on one I posted some time ago The numbers are stored in a text file "Settings.ini" which is saved for convenience in the Word Startup folder (though you can use another path if you prefer. The macro reads the next number from the ini file, types it in the bookmarked cell then prints the document. The number is then incremented by one and the process repeated as many times as you request certificates from the input box. Finally the next number is written to the ini file for next time. I have added a macro to reset the number should that be required. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As Integer Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Reciepts", 1) 'Save invoice number in the Word startup folder. SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount With Selection .GoTo What:=wdGoToBookmark, _ name:="RecNo" .TypeText Text:=Format(Order, "00000") End With ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset Receipt Number?", "Reset", Order) Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order - 1 End Sub http://www.gmayor.com/installing_macro.htm Put a bookmark named "RecNo" on the receipt document where you want the number to appear and run the macro to print as many incremented receipts as you require. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hmm, I am new to merging. But from examples given, it seem to capture data from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#13
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Hi Graham,
Need another help. I would like to put the serial number & barcode (which is basically just a different font). I cannot repeat inserting the same bookmark. It seems that I cannot use the same bookmark at 2 different locations. Is there any other way besides renaming macros? "Graham Mayor" wrote: Graham Mayor wrote: ' ActiveDocument.PrintOut Oops - You had better remove the apostrophe from the start of the line above (used while testing) or it won't print ) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Thanks, Graham. I tried the macro method. However when I print it, all the serial numbers will appear one after another. Meaning, at page 2 it will print 0000100002 and page 3 will appear 00001000020003 and so forth. How do I avoid that? "Graham Mayor" wrote: If all the receipts contain exactly the same data apart from the incrementing number then the Excel method shown on the linked page http://www.gmayor.com/Numbered_labels.htm will do the job. See also http://www.gmayor.com/automatic_numbering_documents.htm If you want to avoid mail merge altogether, then you can do so with a macro. The following is a minor variation on one I posted some time ago The numbers are stored in a text file "Settings.ini" which is saved for convenience in the Word Startup folder (though you can use another path if you prefer. The macro reads the next number from the ini file, types it in the bookmarked cell then prints the document. The number is then incremented by one and the process repeated as many times as you request certificates from the input box. Finally the next number is written to the ini file for next time. I have added a macro to reset the number should that be required. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As Integer Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Reciepts", 1) 'Save invoice number in the Word startup folder. SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount With Selection .GoTo What:=wdGoToBookmark, _ name:="RecNo" .TypeText Text:=Format(Order, "00000") End With ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset Receipt Number?", "Reset", Order) Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order - 1 End Sub http://www.gmayor.com/installing_macro.htm Put a bookmark named "RecNo" on the receipt document where you want the number to appear and run the macro to print as many incremented receipts as you require. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hmm, I am new to merging. But from examples given, it seem to capture data from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#14
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Are you saying that the barcode is simply the serial number formatted with a
barcode font, and thus a duplicate of the number that the macro creates? That being the case add a REF field where you want the bar code to appear with a charformat switch as follows {REF RecNo \*Charformat} Use CTRL+F9 for the field brackets {} then format the field with your bar code font. That should work when the macro updates the field. To facilitate that, replace the first macro with the revised version below: Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As String Dim rRecNo As Range Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Receipts", 1) If iCount = "" Then Exit Sub SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount Set rRecNo = ActiveDocument.Bookmarks("RecNo").Range rRecNo.Text = Format(Order, "00000") With ActiveDocument .Bookmarks.Add "RecNo", rRecNo .Fields.Update .ActiveWindow.View.ShowFieldCodes = False .PrintOut End With Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub If that is not what you are saying, can you clarify how the bar code relates to your document and its serial number. I take it you realise that the number of digits in the number is created by the format switch in the line rRecNo.Text = Format(Order, "00000") -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hi Graham, Need another help. I would like to put the serial number & barcode (which is basically just a different font). I cannot repeat inserting the same bookmark. It seems that I cannot use the same bookmark at 2 different locations. Is there any other way besides renaming macros? "Graham Mayor" wrote: Graham Mayor wrote: ' ActiveDocument.PrintOut Oops - You had better remove the apostrophe from the start of the line above (used while testing) or it won't print ) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
#15
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
You are welcome
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Thanks very much, Graham. It works like a charm. "Graham Mayor" wrote: Graham Mayor wrote: ' ActiveDocument.PrintOut Oops - You had better remove the apostrophe from the start of the line above (used while testing) or it won't print ) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Thanks, Graham. I tried the macro method. However when I print it, all the serial numbers will appear one after another. Meaning, at page 2 it will print 0000100002 and page 3 will appear 00001000020003 and so forth. How do I avoid that? "Graham Mayor" wrote: If all the receipts contain exactly the same data apart from the incrementing number then the Excel method shown on the linked page http://www.gmayor.com/Numbered_labels.htm will do the job. See also http://www.gmayor.com/automatic_numbering_documents.htm If you want to avoid mail merge altogether, then you can do so with a macro. The following is a minor variation on one I posted some time ago The numbers are stored in a text file "Settings.ini" which is saved for convenience in the Word Startup folder (though you can use another path if you prefer. The macro reads the next number from the ini file, types it in the bookmarked cell then prints the document. The number is then incremented by one and the process repeated as many times as you request certificates from the input box. Finally the next number is written to the ini file for next time. I have added a macro to reset the number should that be required. Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As Integer Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Reciepts", 1) 'Save invoice number in the Word startup folder. SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount With Selection .GoTo What:=wdGoToBookmark, _ name:="RecNo" .TypeText Text:=Format(Order, "00000") End With ActiveDocument.PrintOut Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub Sub ResetReceiptNo() Dim SettingsFile As String Dim Order As String Dim sQuery As String SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" 'SettingsFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & _ "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") sQuery = InputBox("Reset Receipt Number?", "Reset", Order) Order = sQuery System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order - 1 End Sub http://www.gmayor.com/installing_macro.htm Put a bookmark named "RecNo" on the receipt document where you want the number to appear and run the macro to print as many incremented receipts as you require. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hmm, I am new to merging. But from examples given, it seem to capture data from outlook contacts. It doesnt help much as I am printing receipts - no contact details needed. Just a running number at the top of the receipt. "Suzanne S. Barnhill" wrote: I think what Graham was saying was that "labels" are the way to do it. See http://www.gmayor.com/Numbered_labels.htm. Understand, they don't have to *be* labels, just set up with a table like labels. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "jaysan3" wrote in message ... Something like labels. It is like I want to create a form that has its own serial number. I dont want to create 100 pages of that same form. Easiest example is a cheque book. The number increases but the cheque is still the same. "Graham Mayor" wrote: Labels? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: I would like to print 1000 receipts using Word or Excel but dont want to create that number of pages. Is there any shorter way to do it? |
#16
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
Many thanks, Graham. The {REF RecNo} was what I was looking for. Just to put
in multiple instances of the serial number. Then I just changed the font before running the macro. Thanks again, Graham. You have solved my problem "Graham Mayor" wrote: Are you saying that the barcode is simply the serial number formatted with a barcode font, and thus a duplicate of the number that the macro creates? That being the case add a REF field where you want the bar code to appear with a charformat switch as follows {REF RecNo \*Charformat} Use CTRL+F9 for the field brackets {} then format the field with your bar code font. That should work when the macro updates the field. To facilitate that, replace the first macro with the revised version below: Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As String Dim rRecNo As Range Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Receipts", 1) If iCount = "" Then Exit Sub SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount Set rRecNo = ActiveDocument.Bookmarks("RecNo").Range rRecNo.Text = Format(Order, "00000") With ActiveDocument .Bookmarks.Add "RecNo", rRecNo .Fields.Update .ActiveWindow.View.ShowFieldCodes = False .PrintOut End With Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub If that is not what you are saying, can you clarify how the bar code relates to your document and its serial number. I take it you realise that the number of digits in the number is created by the format switch in the line rRecNo.Text = Format(Order, "00000") -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hi Graham, Need another help. I would like to put the serial number & barcode (which is basically just a different font). I cannot repeat inserting the same bookmark. It seems that I cannot use the same bookmark at 2 different locations. Is there any other way besides renaming macros? "Graham Mayor" wrote: Graham Mayor wrote: ' ActiveDocument.PrintOut Oops - You had better remove the apostrophe from the start of the line above (used while testing) or it won't print ) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
#17
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
print receipts with running number without creating many pages
You are welcome
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Many thanks, Graham. The {REF RecNo} was what I was looking for. Just to put in multiple instances of the serial number. Then I just changed the font before running the macro. Thanks again, Graham. You have solved my problem "Graham Mayor" wrote: Are you saying that the barcode is simply the serial number formatted with a barcode font, and thus a duplicate of the number that the macro creates? That being the case add a REF field where you want the bar code to appear with a charformat switch as follows {REF RecNo \*Charformat} Use CTRL+F9 for the field brackets {} then format the field with your bar code font. That should work when the macro updates the field. To facilitate that, replace the first macro with the revised version below: Sub AddNoFromINIFileToBookmark() Dim SettingsFile As String Dim Order As String Dim iCount As String Dim rRecNo As Range Dim i As Long iCount = InputBox("Print how many receipts?", _ "Print Receipts", 1) If iCount = "" Then Exit Sub SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini" Order = System.PrivateProfileString(SettingsFile, _ "ReceiptNumber", "Order") If Order = "" Then Order = 1 End If For i = 1 To iCount Set rRecNo = ActiveDocument.Bookmarks("RecNo").Range rRecNo.Text = Format(Order, "00000") With ActiveDocument .Bookmarks.Add "RecNo", rRecNo .Fields.Update .ActiveWindow.View.ShowFieldCodes = False .PrintOut End With Order = Order + 1 Next System.PrivateProfileString(SettingsFile, "ReceiptNumber", _ "Order") = Order End Sub If that is not what you are saying, can you clarify how the bar code relates to your document and its serial number. I take it you realise that the number of digits in the number is created by the format switch in the line rRecNo.Text = Format(Order, "00000") -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jaysan3 wrote: Hi Graham, Need another help. I would like to put the serial number & barcode (which is basically just a different font). I cannot repeat inserting the same bookmark. It seems that I cannot use the same bookmark at 2 different locations. Is there any other way besides renaming macros? "Graham Mayor" wrote: Graham Mayor wrote: ' ActiveDocument.PrintOut Oops - You had better remove the apostrophe from the start of the line above (used while testing) or it won't print ) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pages Running together-- | Microsoft Word Help | |||
what does print spooler service not running mean?can't print.. | New Users | |||
Please help me. My pages are running together. | New Users | |||
Cannot print a certain number of pages in a document | Microsoft Word Help | |||
How can I print the same page number on consecutive pages in word? | Microsoft Word Help |