Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2016, 03:35 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Question 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.
Reply With Quote
  #2  
Old 11-22-2016, 07:07 AM
gmayor's Avatar
gmayor gmayor is offline How can I customize my own content controller for a word form in office 2013? Windows 10 How can I customize my own content controller for a word form in office 2013? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 11-22-2016, 08:21 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
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.
Hello. Thank you for your answer.

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"?
Reply With Quote
  #4  
Old 11-22-2016, 09:51 PM
gmayor's Avatar
gmayor gmayor is offline How can I customize my own content controller for a word form in office 2013? Windows 10 How can I customize my own content controller for a word form in office 2013? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

See attached example
This uses named rich text content controls to achieve the desired effect in conjunction with a macro.
Attached Files
File Type: docm Shoes size.docm (32.7 KB, 11 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 11-23-2016, 03:01 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
See attached example
This uses named rich text content controls to achieve the desired effect in conjunction with a macro.
Wow... How did you do this??? That's genius..
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)..?
Reply With Quote
  #6  
Old 11-23-2016, 04:30 AM
gmayor's Avatar
gmayor gmayor is offline How can I customize my own content controller for a word form in office 2013? Windows 10 How can I customize my own content controller for a word form in office 2013? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #7  
Old 11-23-2016, 04:42 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
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.

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)?
Reply With Quote
  #8  
Old 11-23-2016, 05:14 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Default

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(?)
Reply With Quote
  #9  
Old 11-23-2016, 06:22 AM
gmayor's Avatar
gmayor gmayor is offline How can I customize my own content controller for a word form in office 2013? Windows 10 How can I customize my own content controller for a word form in office 2013? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #10  
Old 11-23-2016, 06:37 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
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.
See my new message down..

Last edited by gwork; 11-23-2016 at 09:02 AM.
Reply With Quote
  #11  
Old 11-23-2016, 06:51 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
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.
I went ahead and created a file using your code in both English and another language. Open the file and you'll be able to see that your code works perfectly when the words are in English (the CCA, CCB set) but it doesn't work on the other language (the DDA, DDB set). PLUS, once you change the DDA, DDB etc set into English words, it DOES work. This is so odd.
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.
Attached Files
File Type: docm Example.docm (25.4 KB, 13 views)
Reply With Quote
  #12  
Old 11-23-2016, 09:42 PM
gmayor's Avatar
gmayor gmayor is offline How can I customize my own content controller for a word form in office 2013? Windows 10 How can I customize my own content controller for a word form in office 2013? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #13  
Old 11-24-2016, 02:38 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
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.
Exactly. I figured it had to do with the font, 'cause Calibri in English always worked..
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!
Reply With Quote
  #14  
Old 11-24-2016, 05:30 AM
gmayor's Avatar
gmayor gmayor is offline How can I customize my own content controller for a word form in office 2013? Windows 10 How can I customize my own content controller for a word form in office 2013? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #15  
Old 11-24-2016, 05:59 AM
gwork gwork is offline How can I customize my own content controller for a word form in office 2013? Windows 7 64bit How can I customize my own content controller for a word form in office 2013? Office 2013
Novice
How can I customize my own content controller for a word form in office 2013?
 
Join Date: Nov 2016
Posts: 12
gwork is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
The code does work. You need a Hebrew font that has bold and normal versions.
Oh I understand now.
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?
Reply With Quote
Reply

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
How can I customize my own content controller for a word form in office 2013? Content Control Field Names/Titles Word Form shammi_raj Word VBA 3 03-10-2016 02:54 AM
How can I customize my own content controller for a word form in office 2013? Finding field names in a Word-Form created by content control shammi_raj Word 1 03-10-2016 02:37 AM
How can I customize my own content controller for a word form in office 2013? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft