PDA

View Full Version : Save document created from Template



sharky12345
01-25-2015, 02:14 AM
I want to save a document created from a template and I need it to be saved in the path of the template itself, not the usual windows template path.

This is what I have at the moment if someone can help me tweak it to do what I need, (I have been using this prior to changing the original document to a template);


ActiveDocument.SaveAs ActiveDocument.path & "\Returns\Return - Name " & txtName.Text & ".docm"

gmayor
01-25-2015, 04:40 AM
Provided the macro is in the document template in question

ActiveDocument.SaveAs ThisDocument.Path & "\Returns\Return - Name " & txtName.Text & ".docm"
The macros will remain in the template, so unless you are adding macros to the document, save it as docx format rather than docm.

sharky12345
01-25-2015, 04:56 AM
Graham, thanks - I didn't know that about the docx bit - I thought if I saved it as that then went on to open it later the macros would be disabled...thanks again.

gmayor
01-25-2015, 05:21 AM
Provided the document can still see the template, the macros will still be available to the document, when it is opened subsequently.

sharky12345
01-25-2015, 05:28 AM
Super - thank you again.