The error message concerns the file save location. I don't have Vista so I
cannot test whether Vista will let you write to the root of the C drive,
however with a small change the macro will change to a different folder - in
the following example the Word Startup Folder. So try the following
variation
The line
SettingsFile="C:\Path\Settings.txt"
is an alternative for the line that follows should you wish to nominate a
specific folder that you have write access to, to store the settings.txt
file.
Sub AutoNew()
Dim SettingsFile As String
'SettingsFile="C:\Path\Settings.txt"
SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.txt"
Order = System.PrivateProfileString(SettingsFile, _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString(SettingsFile, "MacroSettings", _
"Order") = Order
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "00#")
ActiveDocument.SaveAs FileName:="path" & Format(Order, "00#")
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>