How to save current file after detaching from template?

C

Chad Knudson

I have a macro that helps setup the document I create and I have a Save
Final macro that detaches the document from the template and attempts to
save the file. Once I set the template to the normal template, it no longer
has access to my macro source and it doesn't save the file. When I go to
close my document I'm prompted to save it again since it's marked dirty due
to the change in attached template.

ActiveDocument.Save
ActiveDocument.AttachedTemplate = NormalTemplate
ActiveDocument.Save ' Never gets executed

What can I do to initiate a save after setting the AttachedTemplate
property?
 
J

Jonathan West

Chad Knudson said:
I have a macro that helps setup the document I create and I have a Save
Final macro that detaches the document from the template and attempts to
save the file. Once I set the template to the normal template, it no longer
has access to my macro source and it doesn't save the file. When I go to
close my document I'm prompted to save it again since it's marked dirty due
to the change in attached template.

ActiveDocument.Save
ActiveDocument.AttachedTemplate = NormalTemplate
ActiveDocument.Save ' Never gets executed

What can I do to initiate a save after setting the AttachedTemplate
property?

Hi Chad,

Change your code as follows

ActiveDocument.Save
ActiveDocument.AttachedTemplate = NormalTemplate
ActiveDocument.Saved = False
ActiveDocument.Save
 
C

Chad Knudson

Problem with that is that after the AttachedTemplate property is changed,
the next line of code doesn't execute.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top