Graham
Tue Aug 10 03:59:48 CDT 2004
I use something similar which could be set up as an autoopen macro, though I
prefer to run it manually from a toolbar button. It is based on Doug
Robbin's web page -
http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm which
will provide the background. You will need to set the path and the original
filename. Use a unique file - here c:\settings.txt - to hold the count.
Sub SaveNumberedVersion()
'Based on code by Doug Robbins
Dim strPath, strFile As String
strPath = "D:\My Documents\Test\" 'set path
strFile = "My File " 'set filename
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.SaveAs FileName:=strPath & strFile & _
Format(Order, "00#")
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site
http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
arjun dutta wrote:
> i have a file called "abc1.doc".. can u suggest something
> that whenever i edit the file, it will automatically be
> renamed as "abc2.doc" . whenever i edit +1 will be added
> automatically.
> eg: "abc3.doc" then "abc4.doc" etc..
>
> i hope u understand my question.
> KINDLY PLEASE REPLY TO MY EMAIL ADDRESS ALSO..
> thank you
> My email: arjundutta12@hotmail.com