Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating sequentially numbered documents (such as invoices)

33 views
Skip to first unread message

Barb

unread,
Jan 16, 2004, 4:20:01 PM1/16/04
to
I was looking for a macro that would create a sequential number for
certificates that I create using a merge. Since I am not a programmer and
the only macros I've made were from recording keystrokes, I found the
following article with a great macro that worked on one computer but keeps
giving me errors when I try to use it on another
http://www.mvps.org/word/FAQs/MacrosVBA/NumberDocs.htm
I cut and pasted the code that was in the article. Does it create the
Settings.txt doc the first time it runs correctly? I tried copying the
Settings file to the other compueter too and it still didn't work. Any
ideas? Here's the code that I cut and pasted; the errors generated are
syntax, incorrect character, and a couple of others.
Sub AutoNew()

'

'Sub AutoNew()

Order = System.PrivateProfileString("C:\Settings.Txt", _

"MacroSettings", "Order")

If Order = "" Then

Order = 1

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


Word Heretic

unread,
Jan 16, 2004, 7:15:48 PM1/16/04
to
G'day "Barb" <bar...@goeaston.net>,

at a glance it all looks ok to me - what err do u get and where?


Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Barb was spinning this yarn:

lawjmon...@gmail.com

unread,
Feb 9, 2015, 4:54:39 PM2/9/15
to
Did you ever get an answer on this issue, I'am having the same problems,

--mike

Stefan Blom

unread,
Feb 16, 2015, 2:17:06 PM2/16/15
to
Have you tried the macros in the article below?

http://word.mvps.org/faqs/macrosvba/NumberDocs.htm

For installation instructions, see
http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP




<lawjmon...@gmail.com> wrote in message
news:cd7ec609-ec18-429b...@googlegroups.com...
0 new messages