View Single Post
  #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