sequentially numbered documents

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
 
D

Doug Robbins - Word MVP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top