Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Diggar
 
Posts: n/a
Default Sequential number generator for raffle tickets

Can I make a sequential number generator from word that will print numbers
starting at any number I choose (ex: 100500) that will print each number on a
seperate ticket?

Thanks
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP
 
Posts: n/a
Default Sequential number generator for raffle tickets

The following is a modification of the code in the article "Sequentially
numbering multiple copies of single document using a macro" at:

http://www.word.mvps.org/FAQs/Macros...piesOf1Doc.htm

that will let you specify the starting number:

Dim Message As String, Title As String, Default As String, NumCopies As Long
Dim Rng1 As Range

' Set prompt.
Message = "Enter the number of copies that you want to print"
' Set title.
Title = "Print"
' Set default.
Default = "1"

' Display message, title, and default value.
NumCopies = Val(InputBox(Message, Title, Default))
SerialNumber = System.PrivateProfileString("C:\Settings.Txt", _
"MacroSettings", "SerialNumber")

If SerialNumber = "" Then
SerialNumber = InputBox("Enter the starting number", "Set Starting
Number", "1")
End If

Set Rng1 = ActiveDocument.Bookmarks("SerialNumber").Range
Counter = 0

While Counter NumCopies
Rng1.Delete
Rng1.Text = SerialNumber
ActiveDocument.PrintOut
SerialNumber = SerialNumber + 1
Counter = Counter + 1
Wend

'Save the next number back to the Settings.txt file ready for the next use.
System.PrivateProfileString("C:\Settings.txt", "MacroSettings", _
"SerialNumber") = SerialNumber

'Recreate the bookmark ready for the next use.
With ActiveDocument.Bookmarks
.Add Name:="SerialNumber", Range:=Rng1
End With

ActiveDocument.Save

You may however want to consider whether it might not be better to be using
mailmerge for this where you use a column of numbers in an Excel spreadsheet
as the datasource.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Diggar" wrote in message
...
Can I make a sequential number generator from word that will print numbers
starting at any number I choose (ex: 100500) that will print each number
on a
seperate ticket?

Thanks



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Sequential number generator for raffle tickets

See also http://www.gmayor.com/Numbered_labels.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Diggar wrote:
Can I make a sequential number generator from word that will print
numbers starting at any number I choose (ex: 100500) that will print
each number on a seperate ticket?

Thanks



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
 
Posts: n/a
Default Sequential number generator for raffle tickets

Try this

http://www.blocklayer.com/Ticketer

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sequential number compile error burtperks Microsoft Word Help 0 January 12th 06 12:41 PM
Raffle Ticket Template uses same number on all tickets Pooky Microsoft Word Help 1 October 13th 05 04:24 AM
How do I insert chapter number with page number in footer? Joan Microsoft Word Help 4 May 9th 05 04:00 PM
Maximum number of pages in a word document Travis75 Formatting Long Documents 5 January 27th 05 05:03 AM
Sequential numbering for tickets? Skipper7 Microsoft Word Help 2 November 28th 04 01:06 AM


All times are GMT +1. The time now is 12:09 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"