PDA

View Full Version : set save as name



ashgull80
07-13-2012, 08:21 AM
hi
i have a user form that inputs data into a table in word. id like to code it to set the "save as" name and save the word document after it has input the data. i would like it to take the "save as" name from two text boxes in the userform and combine them as 1 name to save the word doc.

eg.

user form
text box 1 = 12001
text box 2 = Mr Smith

word doc save as
12001 Mr Smith

any help please
thanks ash

fumei
07-13-2012, 03:44 PM
Assuming you are willing to accept the default PATH...ActiveDocument.SaveAs Filename:= TextBox1.text & TextBox2.Text

Teeroy
07-13-2012, 03:48 PM
fpath="c:\" 'change to your path
fname = text_box_1 & "_" & text_box_2
ActiveDocument.SaveAs fpath & fname