W
Warren
I have built a template and want it to automatically number.
I have followed the instructions at from
www.word.mvps.org/faqs/macrosvba/numberdocscontent.htm as foloows.
Every time I run it it is giving me an error message for the last two lines.
Help
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.InsertBeforeFormat(Order,"00#")
ActiveDocument.SaveAsFileName:="path"&Format(Order,"00#")
End Sub
I have followed the instructions at from
www.word.mvps.org/faqs/macrosvba/numberdocscontent.htm as foloows.
Every time I run it it is giving me an error message for the last two lines.
Help
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.InsertBeforeFormat(Order,"00#")
ActiveDocument.SaveAsFileName:="path"&Format(Order,"00#")
End Sub