Access 2003 FileSearch / TextOrProperty

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dammato
    New Member
    • Jan 2008
    • 2

    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.Fil eSearch
    .NewSearch
    .LookIn = SelectedMap
    .SearchSubFolde rs = False
    .FileName = NameOfDocument
    .MatchTextExact ly = True
    .TextOrProperty = SearchString
    .FileType = msoFileTypeWord Documents
    '.FileType = msoFileTypeAllF iles

    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
  • daniel aristidou
    Contributor
    • Aug 2007
    • 494

    #2
    Originally posted by Dammato

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

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

    With Application.Fil eSearch
    .NewSearch
    .LookIn = SelectedMap
    .SearchSubFolde rs = False
    .FileName = NameOfDocument
    .MatchTextExact ly = True
    .TextOrProperty = SearchString
    .FileType = msoFileTypeWord Documents
    '.FileType = msoFileTypeAllF iles

    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 "

    Comment

    • Dammato
      New Member
      • Jan 2008
      • 2

      #3
      Originally posted by daniel aristidou
      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

      Comment

      Working...