auto saving to a directory

J

jb914

how do i create a macro to autosave a document to a particular
directory on my server? the document is already named by another
program, so, it's a unique name. the path is always static
z:\backup\documents\2007
 
G

Greg Maxey

This isn't tested because I don't have a server. Try:
Sub NotTested()
Dim strFileName As String
strFileName = "Whatever unique name you use"
ActiveDocument.SaveAs FileName:="z:\backup\documents\2007\ &
strFileName"
End Sub
 
G

Greg Maxey

Sorry, that should be:

ActiveDocument.SaveAs FileName:="z:\backup\documents\2007\" &
strFileName
 
J

jb914

Thanks Greg,
The document name is going to be the current name of the active
document. how do i get that automatically?
 
G

Greg Maxey

Something like this:

Sub Test()
Dim strFileName As String
strFileName = ActiveDocument.Name
End Sub
 

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