473,395 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Access 2003 FileSearch / TextOrProperty

my access-application, I have a selection of "word"-documents. I want to look for a word/string within these documents and make a smaller selection with only those documents that contain that particular word/string

The corresponding code in a loop I use is:

dim SelectedMap, NameOfDocument, SearchString as String
Dim Exists as Boolean

SelectedMap = ...
NameOfDocument = ...
SearchString = ...

With Application.FileSearch
.NewSearch
.LookIn = SelectedMap
.SearchSubFolders = False
.FileName = NameOfDocument
.MatchTextExactly = True
.TextOrProperty = SearchString
.FileType = msoFileTypeWordDocuments
'.FileType = msoFileTypeAllFiles

Exists= .Execute(, , True) > 0
End With

This works fine with ordinay words such as "news" "probably" ..
This doesn't work with strings containing "." or ","
for eaxample "2.2.6", I get wrong results (with or without wildcards)

Does anyone know a solution ?
I'd be very grateful

dammato
Jan 28 '08 #1
2 2035
daniel aristidou
491 256MB

dim SelectedMap, NameOfDocument, SearchString as String
Dim Exists as Boolean

SelectedMap = ...
NameOfDocument = ...
SearchString = ...

With Application.FileSearch
.NewSearch
.LookIn = SelectedMap
.SearchSubFolders = False
.FileName = NameOfDocument
.MatchTextExactly = True
.TextOrProperty = SearchString
.FileType = msoFileTypeWordDocuments
'.FileType = msoFileTypeAllFiles

Exists= .Execute(, , True) > 0
End With

This works fine with ordinay words such as "news" "probably" ..
This doesn't work with strings containing "." or ","
for eaxample "2.2.6", I get wrong results (with or without wildcards)

Does anyone know a solution ?
I'd be very grateful

dammato
Could you please post the code you are using to assign a string to
" SearchString "
Jan 28 '08 #2
Could you please post the code you are using to assign a string to
" SearchString "
The content of SearchString is filled in by the user of the program. He fills the string in by a TextBox in a form

kind regards
Dammato
Mar 12 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Wilson Tan | last post by:
Has anybody encountered any problem with the Execute method or FilesFound property of the FileSearch object in Access 2002? I have this short routine that searches for a specific file that I'm...
11
by: bbasberg | last post by:
Hello, I have been struggling with this problem for DAYS and have googled my heart out as well as reading any books I could get my hands on but I cannot find any specific references to my problem....
2
by: bbasberg | last post by:
I have been working hard to clean up my code but I am still wondering why all incoming records go to the "AddNew" part of the IF statement and never to the Edit alternative. I believe that it must be...
2
by: stuart.medlin | last post by:
I have recently converted an Access 97 database to Access 2003. However, I am running into a problem with using Application.Filesearch to locate a file in my directory. The code follows: ...
1
by: stuart.medlin | last post by:
I have an Access 2003 application that I recently converted from Access 97. I have a routine in which I use to export the data that the users have keyed into a text file. This text file resides...
22
tdw
by: tdw | last post by:
We just added a new login name in our server for a girl named Courtney. She is using a computer that I used to use. The following code in our Orders Database has alway worked fine, but when she is...
5
by: Alice | last post by:
I'm trying to upload all .txt files from a specific folder using the following code, but it didn't work. HELP The problem lies in DoCmd.TransferText acImportFixed, "Imperial Import...
3
by: MLH | last post by:
With Application.FileSearch .NewSearch .LookIn = "C:\My Documents" .SearchSubFolders = True .FileName = "Run" .MatchTextExactly = True .FileType = msoFileTypeAllFiles End With My code pukes...
6
by: MrDeej | last post by:
Hello! I have code wich scans the through 10 computers on a LAN for files and import them into different tabels. This code aproximitly imports 10 000 files (with 1 to 20 rows of info) a day and is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.