Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
JoeP JoeP is offline
external usenet poster
 
Posts: 12
Default Number copies printed

I am new at creating code for macros. I have a created a one page document
that is numbered. I would like for the number to increase (in regular
increments of 1) with each copy printed so that I do not have to manually
change the number before each print.

I found the following code at the site
http://www.word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm

but when I run the macro I get stopped at this part of the code...

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

Here is the code I am using...

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.InsertBefo re Format(Order, "00#")
ActiveDocument.SaveAs FileName:="path" & Format(Order, "00#")

End Sub

Any help would be appreciated.

JoeP
 
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
I need 300 copies of a doc, numbered 1 - 300 how do I number it? Ash Microsoft Word Help 2 October 9th 08 01:16 PM
mailmerging number of copies mar.s.i. Mailmerge 1 August 29th 07 07:16 PM
Numbering individual printed copies senrabbit Tables 1 May 27th 07 10:46 AM
Number * of 150 copies in a label Martin ©¿©¬ @mandeREMOVETHIS.plus.com Tables 4 December 26th 04 02:40 PM
number of copies defaulted at 2 JasonC Microsoft Word Help 1 December 16th 04 07:55 PM


All times are GMT +1. The time now is 05:16 AM.

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

About Us

"It's about Microsoft Word"