![]() |
|
#6
|
|||
|
|||
|
If I assume that you are starting with existing text like:
This is quote bold test test test unbold end quote.This is quote bold test test test unbold end quote. The maybe something like this is what you are after" Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "quote bold*unbold end quote"
.MatchWildcards = True
While .Execute
oRng.Words.First.Delete
oRng.Words.First.Delete
oRng.Words.Last.Delete
oRng.Words.Last.Delete
oRng.Words.Last.Delete
oRng.Bold = True
oRng.InsertBefore """"
oRng.InsertAfter """"
oRng.Characters.Last.Bold = False
oRng.Collapse wdCollapseEnd
Wend
End With
lbl_Exit:
Exit Sub
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to replace straight quotes with smart quotes in existing document
|
PABwriter | Word | 4 | 05-27-2016 03:36 PM |
macro to add brackets to each line and add single quotes to each word in the line
|
bracketandquotes | Word VBA | 17 | 02-16-2015 03:51 PM |
macro to format selected text with curly quotes
|
ysostarman | Word VBA | 10 | 11-11-2014 12:51 PM |
| Macro Needed to bold specific lines and Macro to turn into CSV | anewteacher | Word VBA | 1 | 05-28-2014 03:59 PM |
Changing single-quotes to double-quotes
|
Bobosmite | Word | 5 | 04-15-2013 06:40 AM |