|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How can I customize my own content controller for a word form in office 2013?
Hello everyone.
I'm creating a word form these days. Now, there are quite a few useful content controllers such as "drop down list" button etc, but there's a specific controller that I wanna use but have failed to find/make, so hopefully someone here can help me with that. I wanna insert or create a controller where a person who fills my form will have the option to BOLD their choice. I'll explain: Usually forms contain simple controllers such as: "age: ____" and then a person can fill their age in the BLANK controller. But what I wanna do is put a few options that WILL show on the form and won't be blank and the one filling the form will be able to make their choice bold. For example: a line will be something like "Shoes size: tiny, small, medium, large" and the person filling the form will be able to go through the 4 options and make his choice bold so that it'll look like that: "Shoes size: tiny, small, medium, large". Is there any way to create such a button in a word form? Any help would be appreciated. Thanks. |
#2
|
||||
|
||||
Use a rich text content control. The contents of such a control can be formatted as the user requires. Don't mix legacy form fields and content controls in the same document.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Quote:
1) Can you explain more about your answer or upload a doc file with a rich rext content control that'd function the way I explained in my question? 'Cause I did try using a rick text content control but didn't figure out a way to format it in a way that'll allow me to bold or unbold the content when editing is limited to filling forms only. 2) Can you explain what you mean by "Don't mix legacy form fields and content controls in the same document"? |
#4
|
||||
|
||||
See attached example
This uses named rich text content controls to achieve the desired effect in conjunction with a macro.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
Quote:
I would really appreciate it if you'd write me a short guide on how to create those controls myself on my form... Like.. I should add a rich text content control to my form.. but how do I make the macro thing function the way you did (for the text to get bold once you press on it)..? |
#6
|
||||
|
||||
There are four rich text content controls, one for each selection. Type the list (I copied it from your post) then select each item in turn and apply a rich text content control from the Developer tab.
Each has a unique name and tag. Here they are named and tagged CCA, CCB, CCC, and CCD (right click > properties) Press ALT+F11. The code that makes this work is in the ThisDocument module of the document and works for the set of four. If you want more sets of controls, you will need to add them (obviously with different names) and the code for what happens when you select them. i.e. it makes the selected one bold and the others in the set not bold. The only problem with this is that you need the macro to make it run and some users may not allow that.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#7
|
|||
|
|||
Quote:
Thank you so much. I just entered the Visual Basic option on the doc file you sent me and I'm gonna copy your code to my form in several places so that people will be able to bold their choices throughout the form. Only.. why would people not allow macro? can opening a file with macro in it damage your computer (security-speaking)? |
#8
|
|||
|
|||
I tried copying your code and it worked but only on words written in English. Once I change the content controls' words into another language, the bolding function did not function anymore... I wonder why that is(?)
|
#9
|
||||
|
||||
The language shouldn't make any difference. Did you retain the content control names and tags? The macro only works with content control tags/names that match those in the code.
Macros are capable of holding malicious code, so many people would not allow them to run - especially from persons they don't know or trust.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#10
|
|||
|
|||
Quote:
Last edited by gwork; 11-23-2016 at 09:02 AM. |
#11
|
|||
|
|||
Quote:
Maybe you can figure out why that happens. Perhaps it has to do with the text fonts? The Calibri one does work but the Arial font doesn't.. See if you manage to make it work somehow. That would be amazing if you do. |
#12
|
||||
|
||||
The problem appears to relate to the font itself. If you look at the ribbon when you click the items, you will see that the bold flag comes on, so the macro part is working. There is just no bold version of the font used and some font substitution appears to be taking place.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#13
|
|||
|
|||
Quote:
Do you have any suggestion of how to solve or bypass this issue? I mean, office is supposed to be cleaver enough for macro etc to work on all languages.. I find it pretty odd that a font or a language would "block" a code from working in a document... Otherwise, is there any other way to write a different code that'd do the bolding thing? Maybe a different one would bypass the font issue.. I just don't know how to write VB codes.. so asking for your help, if you could. Thank you! |
#14
|
||||
|
||||
The code does work. You need a Hebrew font that has bold and normal versions.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#15
|
|||
|
|||
Quote:
Ok, I'll try to change the fonts 'till one works (if anything). At any rate, I appreciate all your help. Thank you very much, man! P.s: how did you learn to program stuff (like write codes etc)? Online or you took a course? |
Tags |
controllers, customization, form |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Form with content controls - expands but at the bottom of the form | louiseword | Word | 3 | 05-27-2016 12:47 AM |
Content Control Field Names/Titles Word Form | shammi_raj | Word VBA | 3 | 03-10-2016 02:54 AM |
Finding field names in a Word-Form created by content control | shammi_raj | Word | 1 | 03-10-2016 02:37 AM |
Help with RichText Content Control in Word 2013 | bsparacio311 | Word | 2 | 01-05-2015 03:38 PM |
Who can help me customize the Outlook Contact layout form? | WimYogya | Outlook | 0 | 03-08-2012 10:57 AM |