#1
|
|||
|
|||
Find What Text (^&) is not working for find Italic formatted strings
Hi all
I am exasperated!! I have a document with a lot of text formatted as Italic that I wish to replace with the same text within quotation marks. I googled (as most do) to find an answer - one site described the use of ^& in the replace box: with an answer that said it worked. However, I cannot get it to work!! Can anyone assist please? To be clear, using Ctrl+H I have set the 'Find what' to search for format Italic and added '^&' in to the 'Replace with' box and set format to 'Not Italic'. The result I am getting is; Text is becoming Text''. Any help would be greatly received: Is there a setting somewhere I am missing? Thanks Mercurial |
#2
|
||||
|
||||
Your description suggests you have 'Track Changes' switched on. Switch it off and try again.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
In my experience, if you have any format settings in the Replace box then the replacement formatting happens but the content replacement won't. You need to do this in two steps:
1. Do the replacement as described but don't put any replacement formatting on 2. Either do a second pass with the replace with formatting OR select all and uncheck the italic font setting.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#4
|
|||
|
|||
Hi macropod
Thank you so much for your reply. Yes - I had 'Track Changes' on. I turned this off and it works perfectly! It is unfortunate as I need to show the changes to the author. Really appreciate your time. Many thanks Mercurial |
#5
|
|||
|
|||
Hi Guessed
Thanks for taking the time to reply. macropod hit the nail on the head and it is all working now. Thanks Mercurial |
#6
|
||||
|
||||
You could achieve the desired effect with 'Track Changes' using a macro such as:
Code:
Sub Demo() Application.ScreenUpdating = False Dim i As Long With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "" .Replacement.Text = "" .Font.Italic = True .Forward = True .Wrap = wdFindStop .Format = True End With Do While .Find.Execute i = i + 1 .InsertBefore "(" With .Duplicate .Collapse wdCollapseEnd .Text = ")" .Font.Italic = False End With If .Information(wdWithInTable) = True Then If .End = .Cells(1).Range.End - 1 Then .End = .Cells(1).Range.End .Collapse wdCollapseEnd If .Information(wdAtEndOfRowMarker) = True Then .End = .End + 1 End If End If End If If .End = ActiveDocument.Range.End Then Exit Do .Collapse wdCollapseEnd Loop End With Application.ScreenUpdating = True MsgBox i & " instances found." End Sub For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
find and replace, find what text |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find text, format part of text in italic | d4okeefe | Word VBA | 18 | 06-30-2022 11:35 PM |
How to do a pre-formatted find & replace | paik1002 | Word VBA | 5 | 03-10-2016 10:50 PM |
VBA Word - Find Formatted Text Version Only - Replace From Table | jc491 | Word VBA | 14 | 01-06-2016 08:57 PM |
Find where find text contains a double quote | norgro | Word VBA | 1 | 01-23-2015 10:58 PM |
Find and replace inside strings containing various names | audioman | Word VBA | 4 | 03-25-2014 11:19 AM |