J
jlawson
I'm trying to have vba save a document to a certain sub folder. The
parent folder will already be present but I wanted vba to create a sub
folder if one did not was not present. Like creating monthly sub
folders in the parent folder. With the code I have so far Word just
tells me tha the path is not found. Here is what I have...
Sub savenewfolder()
vYear = Format(Now(), "YYYY")
vMonth = Format(Now(), "MMMM")
vvMonth = Format(Now(), "MM")
vDay = Format(Now(), "DD")
vTime = Format(Now(), "HH:mm")
vName = UserForm1.uname
ChangeFileOpenDirectory "S:\Patient Access Forms\" & vYear & " " &
vMonth & "\"
ActiveDocument.SaveAs FileName:=vYear & vvMonth & vDay & " " &
vTime & vName & ".doc", _
FileFormat:=wdFormatDocument, LockComments:=False,
Password:="", _
AddToRecentFiles:=True, WritePassword:="",
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False,
SaveFormsData _
:=False, SaveAsAOCELetter:=False
End Sub
parent folder will already be present but I wanted vba to create a sub
folder if one did not was not present. Like creating monthly sub
folders in the parent folder. With the code I have so far Word just
tells me tha the path is not found. Here is what I have...
Sub savenewfolder()
vYear = Format(Now(), "YYYY")
vMonth = Format(Now(), "MMMM")
vvMonth = Format(Now(), "MM")
vDay = Format(Now(), "DD")
vTime = Format(Now(), "HH:mm")
vName = UserForm1.uname
ChangeFileOpenDirectory "S:\Patient Access Forms\" & vYear & " " &
vMonth & "\"
ActiveDocument.SaveAs FileName:=vYear & vvMonth & vDay & " " &
vTime & vName & ".doc", _
FileFormat:=wdFormatDocument, LockComments:=False,
Password:="", _
AddToRecentFiles:=True, WritePassword:="",
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False,
SaveFormsData _
:=False, SaveAsAOCELetter:=False
End Sub