PDA

View Full Version : AutoSave with new file name



Sephir
08-16-2007, 11:53 PM
Hello!

I want to save my word doc every X minutes (input from user) with file name increased with number (example: test.doc, test1.doc). I come with this:

ActiveDocument.SaveAs FileName & counter & ".doc"
DoEvents

Application.OnTime When:=Now + TimeValue(sTime), Name:="newSaveDoc"

counter = counter + 1


My questions are:

1. how to check if file is opened, and if it is not, then display message about opening file
2. how to stop this function on file close.
3. how to stop this function manually (i want to let user to stop it manually).
4. any possibility to let user chose directory? i try to use dialog save as, but it gives me .doc and then i get test.doc1.doc

thanx

fumei
08-22-2007, 11:04 AM
1. I do not understand this at all. WHAT file? And where are you putting the code?

2. Further to where is your code...how are you starting this? It seems that you want it to be running all the time. Hmmmm. In any case, closing the file terminates any running code.

3. Same thing. How are you starting it? What do you want as a user interface to stop it?

Try writing better posts with clear information. What you posted as code (and please use the VBA tags) is not very helpful.