![]() |
#1
|
|||
|
|||
![]()
I have some code that will format text within brackets to italics. I would like to modify the code to look for text in brackets only if they appear after a cross reference field or a cross reference manual number after clause, paragraph, part or schedule and format with italics. What do I need to add to the code to achieve this? Any advice would be very much appreciated.
Before Image.JPG After Image.JPG Cross Ref in Brackets Test.docx Code:
Sub DPU_BracketText_Italics() Dim oRng As Range Set oRng = ActiveDocument.Content With oRng.Find .ClearFormatting .text = "\(*\)" .Font.Bold = False .Forward = True .Wrap = wdFindStop .MatchWildcards = True .Format = True Do While .Execute With oRng .MoveEnd Unit:=wdCharacter, count:=-1 .MoveStart Unit:=wdCharacter, count:=1 .Font.Italic = True .Font.Bold = False .Collapse wdCollapseEnd End With Loop End With End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
janiceward | Word | 3 | 05-06-2016 02:51 PM |
![]() |
spunkygirl1983 | Word | 1 | 03-18-2016 03:42 PM |
Convert manual cross references in footnotes to other footnotes to automatic cross references | ghumdinger | Word VBA | 7 | 11-20-2014 11:47 PM |
![]() |
estube | Word | 1 | 07-08-2014 03:21 AM |
![]() |
Richard B | Word | 3 | 09-11-2013 07:18 AM |