PDA

View Full Version : Inserting text into Word



Loin75
06-19-2012, 01:31 AM
Hi,

I have a protected word template. Upon opening, the user is presented with a question via a userform. The answer they give will decide what paragraph is inserted into the protected document.

My problem is that the inserted paragraph needs to have unprotected areas within it.

Using Building Blocks does not offer this flexibility.

Using mergefields with IF statements DOES, but my document do not need or use mergefields...so not sure how to make this method work..

How best can I achieve this please..

Many thanks in advance.
Loin

gmaxey
06-19-2012, 04:43 AM
Have your tried creating your building block using a richtext control (set contents cannot be edit) with nested plain text controls?

Loin75
06-19-2012, 05:43 AM
Thanks for the reply Greg.

No I haven't. And I admittedly don't know how you do that either.

I've tried looking at the options and don't see anything obvious.

Cheers

Frosty
06-19-2012, 09:36 AM
There are only three ways to have both protected areas and unprotected areas in a specific document.

1. Protect the whole document. Interact with the document only through a user form (and then perform the actions by unprotecting the document, making the change via code, and re-protecting the document).

2. Utilize Content Controls. Read up on content controls in the help files. This is a big topic, is only available in Word 2007/2010, but is worth investigating as this is the "right" long-term solution, probably, with the way Microsoft is going.

3. Protect specific sections of a document. This requires inserting section breaks (whether continuous or next page), and then indicating which "sections" of the document should be protected or not. A good understanding of section-level formatting is necessary, as there are quirks and limitations to setting up the sections.

If you wish to have part of a paragraph protected and other parts of a paragraph unprotected, you may not be able to use #3, as inserting a lot of continuous section breaks to make something look like a paragraph would be more trouble than it is worth.

Either way, you have some reading/learning to do. Whether you investigate the "new" way to do this (content controls) or the "old" way (protected document with formfields), can only be answered either by you, or with you providing a sample document (no sensitive data please) so that we can give you more than general answers.

Loin75
06-21-2012, 03:42 AM
Thanks Frosty. I am going to read up on 'content controls' and see where it takes me.

The other options are not possible..

Many thanks for the reply.