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 / March 2004

Tip: Looking for answers? Try searching our database.

Searching Word Documents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dominic - 31 Mar 2004 13:51 GMT
Hi All,

I am looking for a way to search a large number (300k+) of word documents
for a certain pattern of characters.  For example I need to find any
documents that contain the pattern &##### where & = Alphabetic char and # =
Numeric char.  It would flag a document containing A00001.

I have found the search function in VBA but it only works with exact
keywords and not patterns.  Ideally I would like to search these documents
without opening them due to the over head of opening 300,000 docs.  I've
found tools on the web that will search a closed doc file but again they
will only search for keywords and not patterns.

Any suggestions would be most welcome.

Thanks

Dominic

P.S Is there another forum I might be better of asking this?
Dave Lett - 31 Mar 2004 14:29 GMT
Hi Dominic,

VBA does have a pattern match called wildcards. You can use this on a test
document:

With Selection.Find
   .ClearFormatting
   .Text = "[A-Z]{1,1}[0-9]{5,5}"
   .MatchWildcards = True
   .Execute

HTH,
Dave

> Hi All,
>
[quoted text clipped - 16 lines]
>
> P.S Is there another forum I might be better of asking this?
Peter Hewett - 31 Mar 2004 14:49 GMT
Hi Dominic

You need a different approach. Using Word does not appear to be viable.  The
math are horrendous.  Assuming you can Open, Search, Close one document every
second that an 83+ hour job!!!  And you'd hit problems along the way, documents
that wont open, Word crashing (eventually) etc.

I'd look at a third part alternative.  The only gotcha is that unless the
software has knowledge of a Word document the search will search the metadata in
each document (the stuff you don't normally see) as well as the text and this
may through in false positives.

HTH + Cheers - Peter


Dominic <nospam@plz>, said:

>Hi All,
>
[quoted text clipped - 16 lines]
>
>P.S Is there another forum I might be better of asking this?
Dominic Godin - 31 Mar 2004 16:08 GMT
Hi Peter,

I was pretty sure that third party software was needed.  I had written
software that searches docs by opening them and it is very time consuming.  
I need a way of searching through a closed word file to find pattern
matches.  Anybody know of any third party software/components (Delphi or
.net) that are capable of doing this.  I sure they must exist, I'm just
having trouble finding them.

Dominic

> Hi Dominic
>
[quoted text clipped - 35 lines]
>>
>>P.S Is there another forum I might be better of asking this?
 
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.