Macro unprotect doc, make change and re-protect?

A

Ann Scharpf

We are running Word 2003 under Windows XP. Under Word 97, I created forms
templates that had instructional comments. When we upgraded to Word 2003,
everyone HATED how the comments were always displayed as those margin
balloons. So I modified the templates to remove the instructions.

Problem is when people work on old documents. I am creating a toolbar to
add to the template for people to do functions that they've never learned the
right way to do. I'd like to have a button for removing all the comments.
But you can't remove the comments without unprotecting the form. I don't
know VBA yet and am trying to record a macro that will first turn off the
protection, then remove all the comments and turn the protection right back
on. Can't record a macro this way because you can't record the macro if
protection is turned on. Can't back into it either and edit the macro
because if protection is turned off and I turn on as first step of macro, it
kills the record.

Is there some way I can accomplish this?

Thanks for your advice.

Ann
 
C

Charles Kenyon

Unprotect manually, record your macro and save. Then edit the macro to start
it by unprotecting and finish by protecting.
http://word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm
http://word.mvps.org/FAQs/MacrosVBA/TurnFmFlfResetOff.htm
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
A

Ann Scharpf

Thank you! That worked like a gem. I copied the code out of the document in
the second link and it did just what I needed.
 
C

Charles Kenyon

Glad to have been able to help point the way.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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