Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Oct 2001
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    filesearch object (word xp dutch)

    I'm unable to find jpg files with the filesearch object. Is there a way to find image files?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: filesearch object (word xp dutch)

    Code like this works for me:

    With Application.FileSearch
    .LookIn = "C:Images"
    .SearchSubFolders = True
    .FileType = msoFileTypeAllFiles
    .FileName = "*.jpg"
    .Execute
    MsgBox .FoundFiles.Count
    End With

  3. #3
    Lounger
    Join Date
    Oct 2001
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: filesearch object (word xp dutch)

    Hans, Thank you for your example code. It works fine in Word 2000 but not in Word xp. In Word xp it returns zero files. Is there a difference between Word2000 and Word xp?
    Regards, Rico

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: filesearch object (word xp dutch)

    I tested the code on Word 2002 SP-2 (Dutch). I experienced no problems. Make sure that you entered the name of the folder to look in correctly. If you misspell it, so that the .Lookin property points to a non-existing folder, you don't get an error message; .FoundFiles.Count will just be 0.

  5. #5
    Lounger
    Join Date
    Oct 2001
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: filesearch object (word xp dutch)

    That might be the case.
    Thanks again Rico

  6. #6
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: filesearch object (word xp dutch)

    Thank you for that Hans
    You may be surprised at how often you help me out, long before I recognize that I have a problem.
    Regards
    Don

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •