![]() |
|
#1
|
|||
|
|||
|
I am trying to put together a macro that formats all plain double quotes if they are either side of bold text within a word document. I know how to do a find of ("(*)") if all the text is plain but I can't seem to work out how to find a plain quote with bold text. Can anyone help at all. Thanks
Find Plain Quotes.docx Capture.JPG |
|
#2
|
|||
|
|||
|
Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = Chr(34)
.Font.Bold = False
While .Execute
oRng.Select
On Error Resume Next
If oRng.Characters.Last.Next.Font.Bold = True Then oRng.Font.Bold = True
If oRng.Characters.Last.Previous.Font.Bold = True Then oRng.Font.Bold = True
Wend
End With
lbl_Exit:
Exit Sub
End Sub
|
|
#3
|
|||
|
|||
|
Thank you so much Greg for taking the time to provide this code, works perfectly, much appreciated
|
|
#4
|
|||
|
|||
|
You are welcome. Glad I could help.
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem when changing single-quotes to double-quotes | Lup | Word | 14 | 02-14-2020 02:46 AM |
How to replace straight quotes with smart quotes in existing document
|
PABwriter | Word | 4 | 05-27-2016 03:36 PM |
| Changing dumb quotes to smart quotes | Reisende | Word | 2 | 05-02-2016 08:56 PM |
| Creating macro in 2007 to bold within quotes on the fly | marymaryt | Word VBA | 5 | 06-01-2015 06:55 AM |
Changing single-quotes to double-quotes
|
Bobosmite | Word | 5 | 04-15-2013 06:40 AM |