Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 02-13-2016, 09:10 AM
gmaxey gmaxey is offline Macro to find and replace headings in bold and underline Windows 7 32bit Macro to find and replace headings in bold and underline Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You didn't answer the question asked. If a particular style is applied to all of the headings (and not other text) then it is simply a matter of modifying the style to include bold and underline font attributes.

Regardless, here is a macro that might meet your needs:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim arrFind() As String
Dim lngIndex As Long
Dim oRng As Range
  arrFind = Split("HISTORY OF PRESENT ILLNESS:,PHYSICAL EXAM:,RADIOGRAPHS:,SOCIAL HISTORY:,FAMILY HISTORY:,REVIEW OF SYSTEM:," _
                & "BRIEF HISTORY:,CLINICAL EXAM:,ASSESSMENT AND PLAN:,IMPRESSION AND PLAN:", ",")
  For lngIndex = 0 To UBound(arrFind)
    Set oRng = ActiveDocument.Range
    With oRng.Find
      .Text = arrFind(lngIndex)
      With .Replacement
        .Text = arrFind(lngIndex)
        .Font.Bold = True
        .Font.Underline = True
      End With
      .Execute Replace:=wdReplaceAll
    End With
  Next
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to find and replace headings in bold and underline Find, select, and replace part of text with bold paik1002 Word VBA 4 12-07-2015 11:24 PM
Macro to find and replace headings in bold and underline Adding bold colons at end of bold row headings bertietheblue Word Tables 2 07-26-2015 07:26 AM
Macro to find and replace headings in bold and underline Select text to be underline and bold ksigcajun Word VBA 1 03-16-2015 07:51 PM
Macro to find and replace headings in bold and underline Find/Replace Wildcard Needed-Bold & Highlight rsrasc Word VBA 3 11-11-2014 03:55 PM
Macro to find and replace headings in bold and underline find and replace in bold redzan Word VBA 1 07-27-2014 03:35 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:49 AM.


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