There should be a space before the F of Format and the F of Filename
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
"Warren"
news:F13704FA-A940-422B-A5B3-6E5C4495B6AD@microsoft.com...
>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
>