View Single Post
 
Old 06-01-2015, 06:55 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote