S
Susan
this is a small public portion of a larger userform code. in the past
i've just let the documents save in the same folder where the userform
document is, then move it manually. wanted to try to make it save in
the correct place........... won't work - saves it in the same folder
as the document with the userform - even though when stepping thru &
using intellisense, all seems to be correct. i'm posting the code but
i know the word wrap is going to kill it & make it hard to read
(sorry).
variables are all declared elsewhere as public.
any ideas would be greatly appreciated!
thanks
susan
'===============================
Option Explicit
Public Sub MyPath()
Name1 = UserForm1.txtName1
Lastname = UserForm1.txtLastName
Year = UserForm1.txtYear
myFolder = Lastname & ", " & Name1
If UserForm1.chkLF.Value = True Then
PathName = "\\Snowbeltserver\Server\marilyn\My Documents\Apartments\"
_
& "LF & PL ELDERLY\Elderly Tenant Folders\LF515\" & myFolder
End If
If UserForm1.chkPL.Value = True Then
PathName = "\\Snowbeltserver\Server\marilyn\My Documents\Apartments\"
_
& "LF & PL ELDERLY\Elderly Tenant Folders\PL515\" & myFolder
End If
MyFileName = ActiveDocument.Name & "_" & Lastname & "-" & Year
ActiveDocument.SaveAs FileName:=MyFileName,
FileFormat:=wdFormatDocument
End Sub
i've just let the documents save in the same folder where the userform
document is, then move it manually. wanted to try to make it save in
the correct place........... won't work - saves it in the same folder
as the document with the userform - even though when stepping thru &
using intellisense, all seems to be correct. i'm posting the code but
i know the word wrap is going to kill it & make it hard to read
(sorry).
variables are all declared elsewhere as public.
any ideas would be greatly appreciated!
thanks
susan
'===============================
Option Explicit
Public Sub MyPath()
Name1 = UserForm1.txtName1
Lastname = UserForm1.txtLastName
Year = UserForm1.txtYear
myFolder = Lastname & ", " & Name1
If UserForm1.chkLF.Value = True Then
PathName = "\\Snowbeltserver\Server\marilyn\My Documents\Apartments\"
_
& "LF & PL ELDERLY\Elderly Tenant Folders\LF515\" & myFolder
End If
If UserForm1.chkPL.Value = True Then
PathName = "\\Snowbeltserver\Server\marilyn\My Documents\Apartments\"
_
& "LF & PL ELDERLY\Elderly Tenant Folders\PL515\" & myFolder
End If
MyFileName = ActiveDocument.Name & "_" & Lastname & "-" & Year
ActiveDocument.SaveAs FileName:=MyFileName,
FileFormat:=wdFormatDocument
End Sub