8 replies
by steved
by cgtull
by garlin
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
by cgtull
IT IS IN EXCEL 97 I AM SORRY. PLEASE HELP! :O( BUT VERY VERY INFORMATIVE IN WORD. I MAY KEEP THE IDEA FOR LATER USE IN WORD.
THANKS.
by steved
Create a macro something like this:
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.)
by steved
by cgtull
by cgtull
This discussion is closed to new replies.
Trending Software posts
Sort by Trending