View Single Post
 
Old 09-21-2020, 02:05 PM
savvy savvy is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2020
Location: Toronto
Posts: 17
savvy is on a distinguished road
Default saving with wrong name

I want to save file as:

firstname.lastname.docx
in folder c:\users\savvy\documents\final doc\
firstname and lastname are bookmarks from userform

but am getting

runtime error 5152
this is not a valid filename

code:
strPath = Environ("USERPROFILE") & "\Documents\final doc"
ActiveDocument.SaveAs strPath & TextBox2.Text & "." & TextBox1.Text & ".docx"

any advice appreciated
Reply With Quote