Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 10-13-2013, 07:40 AM
sleake sleake is offline How to Turn Off Message "Search from the beginning of a document" in a Macro Windows XP How to Turn Off Message "Search from the beginning of a document" in a Macro Office 2007
Advanced Beginner
How to Turn Off Message "Search from the beginning of a document" in a Macro
 
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
 

Tags
clean up code, suppress messages



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Turn Off Message "Search from the beginning of a document" in a Macro can't turn off "same as previous" traumatiziert Word 8 12-12-2012 03:31 AM
Instant Search's "Display search results as I type when possible" with Exchange lwc Outlook 0 06-01-2011 01:56 AM
How to Turn Off Message "Search from the beginning of a document" in a Macro Instant search not functional because of continuing "indexing" arrigo Outlook 1 12-07-2010 09:13 PM
Outlook search defaulting to "All Mail Items"??? Ninafel Outlook 0 12-02-2010 02:01 PM
Want to search for "class", replacing with document property YetAnotherAuthor Word 0 10-30-2009 09:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft