By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

Access 2003 FileSearch / TextOrProperty

P: 2
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
Share this Question
Share on Google+
2 Replies


daniel aristidou
100+
P: 491

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

P: 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

Post your reply

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