I PRINT SEVERAL HUNDRED BILL OF LADINGS AT MY WORK AND WISH TO KNOW HOW TO CREAT ONE PAGE OF INFORMATION, BUT ON THE OTHER HAND WANT THE PAGE TO AUTOMATICALLY CHANGE BILL NUMBERS WHILE REPETEDLY PRINTING AFTER EACH NUMBER CHANGE. HOW CAN I ACCOMPLISH THIS TASK?
This conversation is currently closed to new comments.
The following article from the September 2000 version of Wordtips may interest you.
In the article is also a link so you can subscribe to future issues.
------------------------------ Printing Copy Numbers, Take Two ------------------------------ In last week's WordTips I featured a tip that discussed how to add copy numbers to a document. The solution relied upon the use of document variables. Unfortunately, this solution will not work in all versions of Word. For instance, if you place the DOCVARIABLE field in the header of a Word 97 document and then print the document, Word will promptly crash.
How to get around this? Simply use a different approach. (Word is nothing, if not flexible.) The following VBA macro is a variation on the one presented last week. It relies on the use of custom document properties instead of document variables. (You can see document properties if you choose Properties from the File menu.)
Public Sub PrintNumberedCopies() Dim varItem As DocumentProperty Dim bExists As Boolean Dim lCopiesToPrint As Long Dim lCounter As Long Dim lCopyNumFrom As Long
' ensure our doc variable exists bExists = False For Each varItem In ActiveDocument.CustomDocumentProperties If varItem.Name = "CopyNum" Then bExists = True Exit For End If Next varItem
' initialize document variable if doesn't exist If Not bExists Then ActiveDocument.CustomDocumentProperties.Add _ Name:="CopyNum", LinkToContent:=False, _ Type:=msoPropertyTypeNumber, Value:=0 End If ' ask how many to print lCopiesToPrint = InputBox( _ Prompt:="How many copies?", _ Title:="Print And Number Copies", _ De
Sub BOL_Print() Dim j As Integer, k As Integer, n As Integer k = 22 n = 252 For j = k To n Range("A2").Select ActiveCell.FormulaR1C1 = CStr(j) ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Next j End Sub
For the values 22 and 252, substitute your own starting and ending bill of lading numbers. For "A2" substitute the cell number where your bill of lading number is contained in the worksheet. I hope this helps.
Steve Diamond
(By the way, if you had left my answer unrated instead of rejecting it, this system might have worked OK. It won't let me start a new answer since I've already answered. If you like this answer, you'll have to try to un-reject my answer, and I'm not sure whether or not it will let you do that.)
THE INFORMATION YOU HAVE SUPPORTED ME WAS EXCELLENT IT DID WORK BUT AS FOR THE 252 I MAY HAVE PRINTED DIDNT HAPPEN. ) I GUESS THATS FAIR FOR REJECTING YOUR ANSWER. "RATE THIS ANSWER" THATS WHAT I DID YOUR FIRST ANSWER DID NOT HELP SO I PUT IT DIDNT HELP..... I AM SORRY AND VERY GREATFUL OF YOUR HELP IN THIS MATTER ) CGTULL@SLAY.COM
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
LOOPED MACROS? HOW?