View Single Post
 
Old 10-13-2013, 07:40 AM
sleake sleake is offline Windows XP Office 2007
Advanced Beginner
 
Join Date: Jul 2011
Posts: 60
sleake is on a distinguished road
Default

Greg: Again, thank you. I discovered in looking at the results, that I had overlooked two other possible things to look for. Spaces after ," and space between a comma and a quote -- , "

Trying to do this on my own with your models, I created the following, but my syntax must be wrong, because it doesn't work:
Code:
 'Space after ," to one space
  With oRng.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "([,""])( {2,9})"
    .Replacement.Text = "\1 "
    .Forward = True
    .Wrap = wdFindStop
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
  End With
   Set oRng = ActiveDocument.Range
Also, the macro does not deal with a space before a quote. Here's the example: , "
I tried inserting "" in the following of your code, but no change:
Code:
 'Space before to no space.
Code:
 With oRng.Find
   .ClearFormatting
   .Replacement.ClearFormatting
   .Text = "( {1,9})(["",.:;])"
   .Replacement.Text = "\2"
   .Forward = True
   .Wrap = wdFindStop
   .MatchWildcards = True
   .Execute Replace:=wdReplaceAll
 End With
I promise this is my last question! At least on this topic.
Reply With Quote