+ Reply to Thread
Results 1 to 2 of 2

FileSearch filter

  1. #1
    AdmSteck
    Guest

    FileSearch filter

    I'm building a custom file import macro to import csv files created by
    another program. They are all saved with the file name format of
    PartNumber~Machine.csv. I am trying to use the application.filesearch object
    to return all the files for a part. I also need to show both the right and
    left part numbers. Some example part numbers are:

    6562 Part 1 Right
    6567 Part 1 Left
    6561 Part 2 Right
    6566 Part 2 Left
    6081 Part 3 Right
    6091 Part 3 Left
    6061 Part 4 Right
    6071 Part 4 Left

    The problem is when I use wildcards in the .filename property of the
    filesearch, it returns part 1 and 2, or 3 and 4. Is there any way to fix
    this so it only shows both right and left of the part I want?

  2. #2
    Peter T
    Guest

    Re: FileSearch filter

    Maybe something like

    sPart = "Part 1"

    ..Filename = "?????" & sPart & "*.cvs"

    Assumes of course the string length before the part name is known, in your
    example 4 numbers and a space (could include that space before the part
    name).

    Regards,
    Peter T



    "AdmSteck" <AdmSteck@discussions.microsoft.com> wrote in message
    news:50B7A3EA-C35A-4462-BBAC-A622778603C2@microsoft.com...
    > I'm building a custom file import macro to import csv files created by
    > another program. They are all saved with the file name format of
    > PartNumber~Machine.csv. I am trying to use the application.filesearch

    object
    > to return all the files for a part. I also need to show both the right

    and
    > left part numbers. Some example part numbers are:
    >
    > 6562 Part 1 Right
    > 6567 Part 1 Left
    > 6561 Part 2 Right
    > 6566 Part 2 Left
    > 6081 Part 3 Right
    > 6091 Part 3 Left
    > 6061 Part 4 Right
    > 6071 Part 4 Left
    >
    > The problem is when I use wildcards in the .filename property of the
    > filesearch, it returns part 1 and 2, or 3 and 4. Is there any way to fix
    > this so it only shows both right and left of the part I want?




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1