A family of Microsoft word processing software products for creating web, email, and print documents.
A macro named AutoNew is intended to run automatically whenever you create a new document based on the document or template that contains the code.
If you want to insert the order number in the current location, it should be an ordinary macro, preferably not named AutoNew.
For example:
Sub InsertNumber()
'
' AutoNew Macro
' Macro created 17-07-2012 by mia
'
Dim Order
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
Selection.InsertAfter Format(Order, "000")
End Sub