Re: WORD template - sequential numbering

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You seem to be referring to http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm rather than the article to which I directed you, http://www.gmayor.com/Numbered_labels.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"iaglarch" <iaglarch@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:ACB0AD93-7233-4D45-8258-345CDA57C0ED@xxxxxxxxxxxxxxxx
I followed the instruction to create sequentially numbered documents (such as
invoices) and the first document opened with the macro enters the specific
number Order = 4209 instead of adding 1 + 4209. Can you tell me from the
attached macro what I am doing incorrectly?

Thanks,

Sub AutoNew()
'
' AutoNew Macro
' Macro created 5/14/2009 by VC of Finance
'
Order = System.PrivateProfileString("C:\Settings.Txt", "MacroSettings",
"Order")
If Order = "" Then
Order = 4209
Else
Order = Order + 1
End If

System.PrivateProfileString("C:Settings.txt", "MacroSettings", "Order") =
Order

ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "00#")
ActiveDocument.SaveAs FileName:="path" & Format(Order, "00#")


End Sub





"Suzanne S. Barnhill" wrote:

You might want to see http://www.gmayor.com/Numbered_labels.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"dgk" <dgk@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:63112B1B-62B6-41DB-9521-882321105BBC@xxxxxxxxxxxxxxxx
> I tried the Autotext and it worked except it prints the (Q#). How do I
> aleviate the brackets and Q. Also do I have to do this 100 times for > 100
> tickets?
>
> "dgk" wrote:
>
> > Thank you I will give that a try :)
> >
> > "Pop`" wrote:
> >
> > > dgk wrote:
> > > > I am trying to figure out how to use this template:
> > > > http://office.microsoft.com/en-ca/templates/TC012265191033.aspx. > > > > How
> > > > do I make 100 tickets and have the numbers automatically update?
> > >
> > > Huh! Good question! I expected to see a macro in the template, or > > > at
least
> > > some way to keep the numbering going for successive pages. It > > > looks
to me
> > > like someone "forgot" something. There's a Black & White version > > > of
another
> > > one too, with the same problem.
> > >
> > > I've lost the source for where I got this, but here's a short blurb > > > on
> > > creating sequential numbers if it helps any.
> > > -------------------
> > > Make an AutoText entry as follows: In the body of any document, > > > type
the
> > > brackets and the letter Q as regular text. Between the Q and the
closing
> > > bracket, insert a Sequence field, which supplies the number. Now
select the
> > > whole thing and press Alt+F3 and assign a name to the AutoText > > > entry
that
> > > you wouldn't ordinarily use as a word, such as "qtag".
> > >
> > > Each time you type that name in text, you'll see a yellow tooltip > > > that
says
> > > "Press Enter to insert". Actually, you can press Enter, Tab, or F3, > > > as
any
> > > of them will insert the AutoText entry.
> > >
> > > If you insert new entries between existing ones, those that follow > > > it
don't
> > > update automatically. You'll have to press Ctrl+A to select the > > > whole
> > > document and then press F9 to update the fields. (Alternatively,
switch to
> > > Print Preview and back.)
> > >
> > > ------------------------------------------
> > >
> > >
> > >
> > > HTH,
> > >
> > >
> > > Pop`
> > >
> > >
> > >



.



Relevant Pages