Is it possible to have a word document automatically save a certain filename based on specified fields in a template?
The word template called Employeeinfo.dot reads:
Employee Information Template
The employee fills out the information in the template.
First Name field: Terri
Last Name field: Smith
Dept Field: Accounting
Location Field: Princeton
Then the employee saves the document.
The word template would save as c:\ Terri Smith - Accounting - Princeton.doc
I tried this code. But it's not working. Part of the code is in red when I placed it in word vb. I think I missed a step.
Dim strFilename As String
strFilename =ActiveDocument.FormFields(1).Result & " " &
ActiveDocument.FormFields(2).Result _
& " " & ActiveDocument.FormFields(3).Result & " " &
ActiveDocument.FormFields(4).Result
ActiveDocument.SaveAs "c:\" & strFilename
Please explain slowly. Thanks for the help in advance.
The word template called Employeeinfo.dot reads:
Employee Information Template
The employee fills out the information in the template.
First Name field: Terri
Last Name field: Smith
Dept Field: Accounting
Location Field: Princeton
Then the employee saves the document.
The word template would save as c:\ Terri Smith - Accounting - Princeton.doc
I tried this code. But it's not working. Part of the code is in red when I placed it in word vb. I think I missed a step.
Dim strFilename As String
strFilename =ActiveDocument.FormFields(1).Result & " " &
ActiveDocument.FormFields(2).Result _
& " " & ActiveDocument.FormFields(3).Result & " " &
ActiveDocument.FormFields(4).Result
ActiveDocument.SaveAs "c:\" & strFilename
Please explain slowly. Thanks for the help in advance.