#16
|
|||
|
|||
I am having all the same problems.
Quote:
Should it not read: iEnd = CInt(InputBox("What is the last certificate to print?", "Print Certificates To", iEnd)) I can't seem to make it print anything at all (Not even if I change this) |
#17
|
||||
|
||||
The code is correct. The reason for the iStart that you queried is that the code defaults to having the starting # as the ending # also.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#18
|
|||
|
|||
This macro and all the tips and hints worked INCREDIBLY well! THANK YOU for taking the time to write all this out and explain all the bits!
|
#19
|
|||
|
|||
works great but i am having an additional problem
i want to say thanks for this information it has helped a lot. I have a similar document but i was hoping to generate numbering for 2 text box location, I am hoping to have them numerical example box A would have the #1 in Box B would have #2 in and on the next copy they would have 3 & 4. if that is an option.
If there is an easier way or better way to do it i would be interested in help. thank you for any help that you can give. |
#20
|
||||
|
||||
Hi JNMZ20,
Aside from making a copy of the textbox for the second number, a few code changes would be needed: Code:
Sub CertificatePrint() Dim iStart As Integer, iEnd As Integer, i As Integer, StrArry On Error GoTo ErrHandler iStart = CInt(InputBox("What is the first Certificate to print?", "Print Certificates From", "1")) iEnd = CInt(InputBox("What is the last Certificate to print?", "Print Certificates To", iStart + 1)) If iStart = 0 Or iStart > iEnd Then Exit Sub With ActiveDocument For i = iStart To iEnd Step 2 With .Shapes(1).TextFrame.TextRange.Fields(1) StrArry = Split(.Code.Text, " ") .Code.Text = Replace(.Code.Text, StrArry(UBound(StrArry)), i) .Update End With With .Shapes(2).TextFrame.TextRange.Fields(1) StrArry = Split(.Code.Text, " ") .Code.Text = Replace(.Code.Text, StrArry(UBound(StrArry)), i + 1) .Update End With .PrintOut Next End With ErrHandler: End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#21
|
|||
|
|||
worked great thank you so much.
|
#22
|
|||
|
|||
Hi All,
I got this working no problem. My issue is that there is no way to setup the printer when using this code. Is there anyway to get the answers to the sequential numbering question and then send it to the printer setup screen? This would allow us to have our printing services run the macro and then print off our materials exactly the way they want (i.e., duplex and staple). Thanks for your help in advance. |
#23
|
||||
|
||||
You could, of course, do you printer setup before running the macro. Indeed, if I were to add something for the print dialogue, I'd probably insert it between:
If iStart = 0 Or iStart > iEnd Then Exit Sub and: With ActiveDocument which would achieve essentially the same thing.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#24
|
|||
|
|||
Thanks for the info. Just to confirm.... There is no way to actually bring up the print dialogue box? It would in fact have to be scripted in? So, if we were to set up the printer BEFORE using the macro, it should run correctly?
Thanks again! |
#25
|
||||
|
||||
Yes and Yes.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#26
|
|||
|
|||
If you have a single document it seems like this should be able to be done without macros?
I have one text box with a field {SEQ SerialNumber \r 10000001 \* MERGEFORMAT} This field has been bookmarked SeqNumBookmark. I have a second text box with a field {SEQ SerialNumber SeqNumBookmark \n \* MERGEFORMAT} I've tried lots of different things but the second text box always has the same sequence number as the first: 10000001 Also, is there a way to print leading zeroes? I saw how it was done with the macro but not sure how to do it with a field. |
#27
|
||||
|
||||
Quote:
That's a simple matter of applying a numeric picture switch to the field.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sequential Page Numbering of Multiple Word Docs | bobmard | Word | 8 | 08-24-2011 08:51 AM |
Numbering ? | MaryLee | Word | 1 | 11-29-2010 12:06 PM |
Numbering Problem | ydbret | Word | 0 | 08-05-2010 12:38 PM |
Subtotaling Sequential 0's | ktpalmer | Excel | 2 | 06-23-2010 06:54 AM |
numbering and formatting | whitemelly | Word | 0 | 02-11-2010 09:06 AM |