![]() |
#6
|
||||
|
||||
![]()
You cannot embolden only the word BOLD in a dropdown form field, unless you convert the field result to plain text (whereupon it will no longer be a form field). You can however embolden the whole field range if the dropdown result contains the world BOLD e.g.
Code:
Public Sub Test1() Dim bProtected As Boolean Dim oFld As FormField If ActiveDocument.ProtectionType <> wdNoProtection Then bProtected = True ActiveDocument.Unprotect Password:="" End If With ActiveDocument.Content.Find .Text = "BOLD" .MatchWildcards = True .MatchCase = True .Replacement.Font.Bold = True .Execute Replace:=wdReplaceAll End With For Each oFld In ActiveDocument.FormFields If InStr(1, oFld.Result, "BOLD") > 0 Then oFld.Range.Font.Bold = True Else oFld.Range.Font.Bold = False End If Next oFld If bProtected = True Then ActiveDocument.Protect _ Type:=wdAllowOnlyFormFields, _ NoReset:=True, _ Password:="" End If End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
cscaudle | Word | 1 | 03-02-2014 10:19 AM |
Drop down menu with different value to display name | swsquish | Word | 1 | 09-04-2012 08:45 PM |
Adding Macro menu to the right click menu (Word 2007) | masam123 | Word | 0 | 10-14-2011 04:05 AM |
Macro will not save to normal.dot file when exiting | bobbraun | Word | 1 | 09-28-2010 06:26 AM |
Merge fields & Drop down menu's | ShadeTree | Word | 0 | 03-09-2010 08:19 AM |