Reply
 
Thread Tools Display Modes
  #1   Report Post  
Kara
 
Posts: n/a
Default Running a macro on a protected document.

I have created a macro that will add lines to a table with the appropriate
form fields in each cell. However, I don't want people changing any other
part of the document except for being able to edit the form fields and add
additional lines to the table.

Can I run a macro on a protected document?

If not, the only other option is to add a table with a style and then allow
editing of that style. Will that work also?

Thank you!
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

Kara wrote:
I have created a macro that will add lines to a table with the
appropriate form fields in each cell. However, I don't want people
changing any other part of the document except for being able to edit
the form fields and add additional lines to the table.

Can I run a macro on a protected document?

If not, the only other option is to add a table with a style and then
allow editing of that style. Will that work also?

Thank you!


Hi Kara,

There are two parts to this... getting the macro started, and allowing the
macro to make changes in the form.

For the first part, provide a toolbar button to launch the macro, as part of
your template. See
http://word.mvps.org/FAQs/Customizat...oToToolbar.htm for
instructions. Although it's possible to use a MacroButton field or a command
button instead, it's more trouble than it's worth to try to keep it from
printing.

For the second part, your macro needs to unprotect the document, insert the
new table row, and reprotect the document. See
http://word.mvps.org/FAQs/MacrosVBA/...ProtectDoc.htm for example
code.

Your second proposal won't work, because a style contains only formatting,
not table rows or fields.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a document in a protected form CheeryNan Microsoft Word Help 5 August 1st 22 07:34 AM
Table in a Form HiDbLevel Tables 12 February 27th 06 01:59 PM
Form Macro doesn't "stay" when others open the document formhelp Microsoft Word Help 1 March 9th 05 06:04 PM
How can I mail merge a 'Protected' document? F. Ferrer Mailmerge 1 February 3rd 05 12:55 AM
How do I make a document protected so that it can not be changed? BJ Microsoft Word Help 3 December 28th 04 08:02 PM


All times are GMT +1. The time now is 04:09 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"