![]() |
|
![]() |
|
Thread Tools | Display Modes |
#16
|
|||
|
|||
![]()
And by the way, there is a font that has normal, bold etc versions, it's "Times New Roman". It does work on the English words but not on the Hebrew ones.
I have a different question: is there any line you can add to the code you wrote that'll "force" the code to work on ANY font? If not, then I guess there's just an unsolved issue with this language.. since I tried ALL possible fonts + the code does work on any latin language (English, Spanish etc etc). This is so unfortunate. |
#17
|
||||
|
||||
![]()
The bolding of Hebrew fonts appears to have nothing to do with the content controls nor the macro, both of which are working correctly. If you type a simple length of Hebrew text, and bold that, it doesn't change, but the bold flag is set. I regret I don't know enough about the internal workings of fonts to explain this.
One answer is to use a contrasting font. For the purpose of experiment I downloaded the fonts Rubik and Suez One from http://freefonts.co.il/ and installed them in Windows. I then modified the code to switch the fonts as follows. This does work with your additional example, using a function to provide the formatting. Code:
Case "DDA" SetFont ContentControl.Range, "Suez One", True SetFont ActiveDocument.SelectContentControlsByTag("DDB").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDC").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDD").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDE").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDF").Item(1).Range Case "DDB" SetFont ContentControl.Range, "Suez One", True SetFont ActiveDocument.SelectContentControlsByTag("DDA").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDC").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDD").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDE").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDF").Item(1).Range Case "DDC" SetFont ContentControl.Range, "Suez One", True SetFont ActiveDocument.SelectContentControlsByTag("DDA").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDB").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDD").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDE").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDF").Item(1).Range Case "DDD" SetFont ContentControl.Range, "Suez One", True SetFont ActiveDocument.SelectContentControlsByTag("DDA").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDB").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDC").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDE").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDF").Item(1).Range Case "DDE" ContentControl.Range.Font.Name = "Suez One" ContentControl.Range.Font.Bold = True SetFont ActiveDocument.SelectContentControlsByTag("DDA").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDB").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDC").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDD").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDF").Item(1).Range Case "DDF" ContentControl.Range.Font.Name = "Suez One" ContentControl.Range.Font.Bold = True SetFont ActiveDocument.SelectContentControlsByTag("DDA").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDB").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDC").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDD").Item(1).Range SetFont ActiveDocument.SelectContentControlsByTag("DDE").Item(1).Range Case Else End Select End Sub Sub SetFont(oRng As Range, Optional sFont As String = "Rubik", Optional bBold As Boolean) oRng.Font.Name = sFont oRng.Font.Bold = bBold End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#18
|
|||
|
|||
![]()
This is SO funny. As I was going through all the fonts yesterday, I noticed that there are fonts that are bold by default, such as Aharoni, Secular One, or in your example- Suez One. So using contrasting fonts for the bolding to happen crossed my mind but then I thought it's probably not possible. BUT, since I know nothing about code writing, I had to give it a shot and so that's why I asked u if there was any way to make it happen, and well, my friend, you did it... you really did. This is a really smart bypass, and apparently it IS possible to write such a code, despite my thinking it wasn't.
I played around with your code and used Suez One + a different font instead of Rubik, and it all works perfectly! Now I'm gonna set your code through my actual forms, see what the result looks like and let you know that it all worked etc. This is genius, you're a genius and this forum rocks! For reals, thank you so so much for everything!! ![]() (You can mark this thread as "solved", as long as I'll still be able to come back here soon and write you that it all worked on my form etc).. |
#19
|
||||
|
||||
![]()
You will have to mark it as solved.
![]()
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#20
|
|||
|
|||
![]()
Just wanted to let you know that everything worked great for me with that last method and code you've given me.
Thanks again for everything! ![]() |
#21
|
||||
|
||||
![]()
If you are still watching, see http://www.gmayor.com/interactive_multichoice.html - I have created a process related to this thread, with much improved code, that you might find useful, and I could use the feedback.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com Last edited by gmayor; 11-30-2016 at 07:42 AM. |
![]() |
Tags |
controllers, customization, form |
Thread Tools | |
Display Modes | |
|
![]() |
||||
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 |
![]() |
shammi_raj | Word VBA | 3 | 03-10-2016 02:54 AM |
![]() |
shammi_raj | Word | 1 | 03-10-2016 02:37 AM |
![]() |
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 |