Word 2010 user form-inserting text fields conditionally

I have created a Word 2010 form for users in different departments; the form has many content controls. I want to be able to add unique additional text fields, based on the user selecting their department in the form. I have tried using quick parts, and I tried creating a text field with autocorrect to replace text if the user keys "#dept1" or "#dept2" etc. The problem is that the quick parts and autocorrect data is stored on my PC, so when another user tries the form these features don't work! The users are not on the same LAN, so there is no common location for me to store the quick parts or autocorrect data. I've been reading through many MVP VBE examples but I am a newbie to VBE. Before I try the examples: does the VBE code "save" into the form so that it will be available to others who use the form on their own PCs? Or is there another, easier way to accomplish this?

 

Thank you!

Hi Robin1626

 

If your form is stored as a template (.dotx or .dotm) it may contain its own Quick parts. First save your form as a template file and then create a Quick part. When you are in the save dialog box select the arrow next to the file name Building Blocks.dotx which is the standard storage area for Quick parts.

 

Perhaps that will solve your issue?

 

Best regards

 

Malin D

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Look into the IF Field. You can put the conditional parts in an IF field that tests by the department picked in a context control. All of the parts will be in the distributed document, but they will only be available if a certain department is picked in your field.

Word Fields

Word Fields Part I : Automate Word Documents With Minimum Code

Making Your MailMerge Intelligent using IF Fields by Dave Rado, MVP

This does not require and visual basic but the setup of these fields can seem arcane.

See the calculated date field at
Calculated Dates in Microsoft Word using Fields or vba for an extreme (to me) example.
Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

One choice to make is whether to use content controls or protected form fields (legacy form fields). See Word Content Controls for a brief comparison. These should not be mixed.

BTW, in Word jargon, a userform is a custom dialog box involving visual basic programming. What you are talking about, I believe, is what Word describes as an On-Line Form.

I have not yet figured out a way to use the value of a content control as a condition in an IF field. That may be more a reflection of my skill than of what is possible. I know that what I am describing works fine in Word documents using legacy form fields that are protected for forms. I regularly have parts of forms that only display and become available if a box is checked or an option is selected. If it is not, they disappear from view.

[Edit]
See the information provided by Paul Edstein and Peter Jamieson on page two of this thread on how to use an IF field with content controls.
http://answers.microsoft.com/en-us/office/forum/office_2010-word/conditional-text-using-if-fields-and-content/9d131482-b87f-40e7-824d-43e645fd9e42?page=2
(Forum control won't let me make that a link)
Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Robin, here is another thread that discussed using content controls to trigger display of other information.
Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you very much for your suggestion! I'll try it.

 

Best,

Robin

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

This looks really promising-it sounds like a straightforward solution to what I am trying to accomplish. I also read your second response, plus the other thread you referenced - and thank you for clarifying what a user form is (VBE), and what it is not (my form!) It will help me phrase any future questions more accurately.

 

I'm looking forward to trying suggestions from both your replies and thread  - thank you again for your help!

 

Best,

Robin

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi Malin -

 

I saved the Word 2010 form I created as a macro-enabled template. I added text and fields in Quick Parts, and did as you suggested, saving it into the template, itself. The problem is that when I turn on protection restricting users to form fill-in, the text in Quick Parts is no longer visible/accessible (I haven't even tested the form from another user's PC, yet - that's next...)

 

I tried splitting off the last section of the form (where conditional text would be added) as a separate section, and not checking the box to protect that section, before turning on protection. But once protection is on, it's still not visible/accessible.

 

What am I doing wrong?

 

Thanks so much for helping,

Robin

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Why are you using protection for filling in forms?  That is for the old legacy formfields, not content controls.

 

See:  http://gregmaxey.mvps.org/word_tip_pages/content_control_fillin_form.html and the heading labeld Retricted Editing

Greg Maxey
***
Death smiles at us all, but all a man can do is smile back.


For more help with Word visit:
http://gregmaxey.com/word_tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I'm not using protection, anymore - your suggestions worked!  I am so excited to a) have the template working, and b) finally be done with it :o)            

 

It's time I take the time to learn and try techniques before I need them - I'll be busy reading and trying MVP tips and techniques for awhile...  any suggestions on best ways to begin learning VBA?

 

Thank you so much,

Robin

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

any suggestions on best ways to begin learning VBA?

 

Troll forums for questions and pull your hair out trying to solve them ;-)

 

You might find this helpful:  http://gregmaxey.mvps.org/word_tip_pages/vba_basics.html

Greg Maxey
***
Death smiles at us all, but all a man can do is smile back.


For more help with Word visit:
http://gregmaxey.com/word_tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 8,667 Applies to: