You want AutoNew to run when the document is created. What are your macro
security settings? Where is your template stored?

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
Hi Charles,
Thanks for the response; actually AutoNew is working just fine for me now.
I do have another question maybe you could help with. I've repeated the code
4 times because there are 4 separate certificates that need numbers.
However, now I'm told not all 4 certificates may be used, so they want to
know if there's a way to specify the number of certificates they want
numbered. Maybe use an input box? But I'm very unsure how to do this. I've
included the code I'm using below.
Sub AutoNew()
Order = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order") = Order
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "0000#")
'***********************************************************************
Order2 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order2 = "" Then
Order2 = 1
Else
Order2 = Order2 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order2") = Order2
ActiveDocument.Bookmarks("Order2").Range.InsertBefore Format(Order2, "0000#")
'********************************************************************************
Order3 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order3 = "" Then
Order3 = 1
Else
Order3 = Order2 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order3") = Order3
ActiveDocument.Bookmarks("Order3").Range.InsertBefore Format(Order3, "0000#")
'***********************************************************************************
Order4 = System.PrivateProfileString("C:\Settings3.Txt", _
"MacroSettings", "Order")
If Order4 = "" Then
Order4 = 1
Else
Order4 = Order3 + 1
End If
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order4") = Order4
ActiveDocument.Bookmarks("Order4").Range.InsertBefore Format(Order4, "0000#")
ActiveDocument.SaveAs FileName:="Meal Tickets" & Format(Order4, "0000#")
System.PrivateProfileString("C:\Settings3.txt", "MacroSettings", _
"Order") = Order4
End Sub
> You want AutoNew to run when the document is created. What are your macro
> security settings? Where is your template stored?
[quoted text clipped - 5 lines]
> > What
> > am I doing wrong? Word 2002. Thanks for the help!
Charles Kenyon - 26 Jan 2006 01:08 GMT
I would use an input box or a userform.
However, I'm a novice and not up on privateprofile strings and so am not the
one to answer this question. I would suggest posting a separate question on
it (with an appropriate subject line).
You may also want to look at
http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm if you haven't already.

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> Hi Charles,
> Thanks for the response; actually AutoNew is working just fine for me now.
[quoted text clipped - 85 lines]
>> > What
>> > am I doing wrong? Word 2002. Thanks for the help!
Jezebel - 26 Jan 2006 01:14 GMT
> I do have another question maybe you could help with. I've repeated the
> code
[quoted text clipped - 4 lines]
> I've
> included the code I'm using below.
Before you put any more effort into solving the problem, invest some time in
*defining* the problem. "Now I'm told..." is no basis on which to write
code. Write down your understanding of what "they" want, and get "them" to
agree to it. Otherwise you will end up with a great solution to the wrong
problem, or vice versa.