Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Numbering / September 2004

Tip: Looking for answers? Try searching our database.

Numbering documents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barb - 16 Sep 2004 16:45 GMT
I am trying to set up a purchase order template. I need
to include a macro that will cause it to come up with the
next consecutive P.O. number each time the template is
opened. A friend found me some instructions on the
internet but I get an error message when I try to create
the macro and when I try to run it, obviously. Here's
what I have:
Sub autonumber()
Dim MyString, autoNumb
FileToOpen = "c:\windows\autonumberfile.txt"
Open FileToOpen for Input As #1
Input #1, autoNumb
Close #1
ActiveDocument.Bookmarks("autonumb").Select
Selection.InsertAfterText:=autoNumb
autoNumb = autoNumb + 1
Open FileToOpen For Output As #1
Write #1, autoNumb
Close #1
End Sub

I rarely use macros so I have no idea what is wrong with
this one. Maybe it was written for a different Word
version and doesn't work in 2002. I would appreciate any
guidance anyone can give me.

Thanks!
Barb
Doug Robbins - 17 Sep 2004 01:44 GMT
See the article "Creating sequentially numbered documents (such as
invoices)" at:

http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

>I am trying to set up a purchase order template. I need
> to include a macro that will cause it to come up with the
[quoted text clipped - 24 lines]
> Thanks!
> Barb
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.