Group: microsoft.public.word.vba.general
From: "Doug Robbins - Word MVP"
Date: Sunday, April 13, 2008 2:44 PM
Subject: Re: sequentially numbered documents

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" wrote in message
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
>


Safety Articles | Usenet Groups | Usenet News | Bluegrass