Disable "do you want to save changes" on a form

W

Wowbagger

I have a protected Word form (created in 2003, used in 2000, 2002 and 2003)
with a handful of fields. After the fields are populated the form will be
printed and the file closed. Is there a way to prevent the "do you want to
save changes" prompt from appearing while the form is in protected mode?
(If I turn off the document protection then I would want the prompt to
appear.)

--
Thanks

"He had had his immortality thrust upon him by an unfortunate accident with
an irrational particle accelerator, a liquid lunch and a pair of rubber
bands. The precise details of the accident are not important because no one
has ever managed to duplicate the exact circumstances under which it
happened, and many people have ended up looking very silly, or dead, or
both, trying."
 
J

Jay Freedman

Wowbagger said:
I have a protected Word form (created in 2003, used in 2000, 2002 and 2003)
with a handful of fields. After the fields are populated the form will be
printed and the file closed. Is there a way to prevent the "do you want to
save changes" prompt from appearing while the form is in protected mode?
(If I turn off the document protection then I would want the prompt to
appear.)

The general idea is laid out in
http://word.mvps.org/FAQs/MacrosVBA/PseudoBeforeClose.htm. The example
there, though, does the opposite of what you want.

In your form template, put this macro in a standard module:

Public Sub AutoClose()
If ActiveDocument.ProtectionType = _
wdAllowOnlyFormFields Then
ActiveDocument.Saved = True
End If
End Sub
 

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

Similar Threads


Top