Hi,
I wrote a macro such that I can save a file with a particular name
(name and surname of a person.doc).
Sub savename()
Dim filename As String
filename = ActiveDocument.FormFields("surname").Result + " " +
ActiveDocument.FormFields("name").Result
ActiveDocument.SaveAs filename:=filename
End SubIt works but I want to create this file in a particular folder
like C:/patient. With this macro I create the file and then I must move
it to that folder. How I can improve this macro to include the path
name in it?
Surena
Martin - 11 Apr 2006 16:56 GMT
It's easier than you think - just put the full path as the filename, e.g.
ActiveDocument.SaveAs "i:\hello.doc"
So your filename line could be:
filename = "C:\patient\" + ActiveDocument.FormFields("surname").Result + " " +
ActiveDocument.FormFields("name").Result
Remember to include the final backslash and make sure it's not a frontslash!
> Hi,
>
[quoted text clipped - 12 lines]
>
> Surena