Prevent Macros from Running in saved Document

B

Barry-W

I have written a template for creating receipts. Due to reasons beyond my
control each receipt has to be saved for printing at a later time. The
receipt has to be read only so that no changes can be made. I have no
problems saving the receipt, but when I open it up again to print it is still
associated with the template and all the macros (and AutoMacros) come to
life. If I copy the saved receipt to a different computer, with out the
template installed, all is fine.

Question is how can I save the receipts so that upon opening for printing
the document is read only and all the macros / template code is dormant?

I played around with saving the receipt as PDF, but could not work out how
to do this without user intervention (i.e. entering the file name).

Any suggestions would be greatly appreciated

Barry
 
J

Jonathan West

Barry-W said:
I have written a template for creating receipts. Due to reasons beyond my
control each receipt has to be saved for printing at a later time. The
receipt has to be read only so that no changes can be made. I have no
problems saving the receipt, but when I open it up again to print it is
still
associated with the template and all the macros (and AutoMacros) come to
life. If I copy the saved receipt to a different computer, with out the
template installed, all is fine.

Question is how can I save the receipts so that upon opening for printing
the document is read only and all the macros / template code is dormant?

I played around with saving the receipt as PDF, but could not work out how
to do this without user intervention (i.e. entering the file name).

Any suggestions would be greatly appreciated

Before saving, set the attached template to normal.dot, instead of the
template it was created from. In code that can be done with this line

ActiveDocument.AttachedTemplate = NormalTemplate
 
B

Barry-W

Boy that was quick, and embarrassingly simple!

Is there a single document, web site etc. that has all of this information
available in a tutorial form. I know there is always the F1 option, but you
need to know where to start before that becomes useful

Again, thanks for the speedy reply Jonathan

Barry
 
J

Jonathan West

Barry-W said:
Boy that was quick, and embarrassingly simple!

Is there a single document, web site etc. that has all of this information
available in a tutorial form. I know there is always the F1 option, but
you
need to know where to start before that becomes useful

That would be a very big website!

You might like to take a look here, which has a lot of information about
Word. Not all there is to know, but much of what people have asked over the
years

http://word.mvps.org
 

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