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 / August 2006

Tip: Looking for answers? Try searching our database.

FileSearch

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
IA - 03 Aug 2006 09:58 GMT
I wrote several macros in Word 95 and 97 which were searching for files with
specific words in the file text, but I cannot convert them into Word 2003 or
write new macro in Word 2003 of this type. I cannot insert words for  search
into the "text or property" property in the FileSearch object:

With Application.FileSearch
     .NewSearch
     .FileType = msoFileTypeOfficeFiles
      .Text Or Property = ???
           .LookIn = Directory
     .Execute

In a way to search for files which contains several keywords. For instance,
I have to find all files in a directory which contains words "bread",
"butter" and "pepper".

In the early versions of Word Basic it was enough to insert "&" between the
search  words, but I do not understand how to make it in Word 2003.
I tryed to record macro from screen, but Word 2003 display empty window
after recording such macro. I cannot use earlier version of Word, because
they cannot open .htm files without frequent crashes.
I make my life money with  searching files in Word, and I am currently  in
the dead end. I am not a programmer, but live forced me to do the simple
things with macro.
Please, if somebody has an idea, help me.

Petr Dombrovski, Graz
Doug Robbins - Word MVP - 03 Aug 2006 11:57 GMT
I would expect that you would need to put the individual words into an array
and then iterate through the elements of the array with you search.

Note that the attribute is TextOrProperty (all one word).

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I wrote several macros in Word 95 and 97 which were searching for files
>with
[quoted text clipped - 28 lines]
>
> Petr Dombrovski, Graz
IA - 03 Aug 2006 13:55 GMT
Yes, but I wonder, why Word 2003 degrade from Word 97? In earlier version it
was possible to use set of words which immediately defined the files which
contains certain words.
This function, by the way, presents in the File->FileSearch option of the
Word 2003, why I cannot use it implemented into the script?

Petr

> I would expect that you would need to put the individual words into an array
> and then iterate through the elements of the array with you search.
[quoted text clipped - 33 lines]
> >
> > Petr Dombrovski, Graz
IA - 03 Aug 2006 15:52 GMT
I found another crasy thing with word 2003. It is written in the Help to
FileSearch:

"In the Search text box, you enter one or more words. Basic searching
returns files containing these words, whether they are in the body of the
file, in keywords or in other file properties. By entering more words in the
Search text box, you make your search more specific and limit the number of
documents found".

It is totally incorrect. The more words one insert into Search text box, the
more files it produce, because guys in Microsoft are totally irresponsible,
and Microsoft has the monopoly.
The reason of such behavoir of FileSerach is in the conditions OR which
pogrammers implement default in the FileSerch option wothout the
alternative. In case one try to insert two words into the program, it does
not work.
I guessed, which commercial intetrest are hidden in this fact, but I came to
conclusion that it is the banal stupidity.
I have the impression that clever programmers left Microsoft forever.

> I would expect that you would need to put the individual words into an array
> and then iterate through the elements of the array with you search.
[quoted text clipped - 33 lines]
> >
> > Petr Dombrovski, Graz
 
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.