Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2005

Tip: Looking for answers? Try searching our database.

Clearing Find parameters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Larry - 06 Jul 2005 21:37 GMT
Is there a single, one line command that puts all the Search parameters
back to their default state?  After doing a search, I always run things
like this:

 With Selection.Find
     .Text = ""
     .Replacement.Text = ""
     .MatchWildcards = False
   End With

But I'm wondering if this is necessary.

Thanks,
Larry
Jay Freedman - 07 Jul 2005 00:53 GMT
>Is there a single, one line command that puts all the Search parameters
>back to their default state?  After doing a search, I always run things
[quoted text clipped - 10 lines]
>Thanks,
>Larry

No, there isn't any single "reset" command. Grab the subroutine
ClearFindAndReplaceParameters from
http://www.word.mvps.org/FAQs/MacrosVBA/ClearFind.htm, and call it
after using Selection.Find. See
http://www.word.mvps.org/FAQs/MacrosVBA/FlushFR.htm for an example of
its use.

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org
Larry - 07 Jul 2005 02:16 GMT
I would be a built-in method:

Selection.Find.DefaultSettings  :-)

> >Is there a single, one line command that puts all the Search parameters
> >back to their default state?  After doing a search, I always run things
[quoted text clipped - 22 lines]
> Jay Freedman
> Microsoft Word MVP         FAQ: http://word.mvps.org
Larry - 07 Jul 2005 02:16 GMT
Hi Jay,

Yeah, of course, I've had that macro and run it in other macros for
years.  I just wondered if there was a simple one-liner instead.  :-)
There ought to be.

Larry

> >Is there a single, one line command that puts all the Search parameters
> >back to their default state?  After doing a search, I always run things
[quoted text clipped - 22 lines]
> Jay Freedman
> Microsoft Word MVP         FAQ: http://word.mvps.org
Jay Freedman - 07 Jul 2005 04:27 GMT
Hi Larry,

I'd say it's a matter of little consequence. Once you have the
subroutine stashed in a global template, then clearing the Find object
*is* a one-liner, just the name of the ClearFindAndReplaceParameters
subroutine. The number of lines inside the subroutine is immaterial,
just as the number of lines of (probably C++) code needed to create a
built-in function in Word itself is immaterial.

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org

>Hi Jay,
>
[quoted text clipped - 32 lines]
>> Jay Freedman
>> Microsoft Word MVP         FAQ: http://word.mvps.org
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.