Open Windows Explorer with wildcard filter?

Hello, a while back, I got help with opening Windows Explorer (in Windows XP) from Access (2003):

    strFldr = "C:\MyFolder"
    strCmd = "explorer.exe /e, " & strFldr
    dblTaskIDWeTempFldr = Shell(strCmd, vbNormalFocus)

Is there a way to add a wildcard filter expression to that? I have trial'd & error'd my way through the examples below, shown on this page:

"Explorer.exe Command-Line Options for Windows XP"
http://support.microsoft.com/kb/314853

...but no luck. I need to open up Windows Explorer on a particular folder that contains many, many, many, thousands of pdf's, filtered to the ones they just produced in a related process. (WE, so they can double-click on any one of them to open and inspect it)

Thanks

Option            Function
   ----------------------------------------------------------------------   
   /n                Opens a new single-pane window for the default
                     selection. This is usually the root of the drive that
                     Windows is installed on. If the window is already
                     open, a duplicate opens.
 
   /e                Opens Windows Explorer in its default view.
 
   /root,<object>    Opens a window view of the specified object.
 
   /select,<object>  Opens a window view with the specified folder, file,
                     or program selected.
 
   Examples
   -----------------------------------------------------------------------
   Example 1: Explorer /select,C:\TestDir\TestProg.exe
              Opens a window view with TestProg selected.
 
   Example 2: Explorer /e,/root,C:\TestDir\TestProg.exe
              Opens Explorer with drive C expanded and TestProg selected.
 
   Example 3: Explorer /root,\\TestSvr\TestShare
              Opens a window view of the specified share.
 
   Example 4: Explorer /root,\\TestSvr\TestShare,select,TestProg.exe
              Opens a window view of the specified share with TestProg selected.

Open in new window

mlagrangeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
There doesn't appear to be any commandline arguments that would do what you want, but I don't use this method so may be wrong. However, the webpage you list is pretty specific about the switches available, and a Filter argument isn't included in the list.

There are ways to display this on a Form with a WebBrowser control, but I can't find the reference to it right now. FWIW, I tried this method some time back with limited results, and eventually switched to using a 3rd party control (http://www.ssware.com, the ActiveX controls) that was much more flexible.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thenelsonCommented:
>I need to open up Windows Explorer on a particular folder that contains many, many, many, thousands of pdf's, filtered to the ones they just produced in a related process. (WE, so they can double-click on any one of them to open and inspect it)<

I would suggest using the Open Save dialog for that. You can apply a filter to display the files you want. The Open Save dialog will return the selected path/filename which you can open with the shell command or they could be opened in a window in your db.

Take a look at http://www.mvps.org/access/api/api0001.htm.
Note: Just copy and paste code after
'***************** Code Start **************
to its own module.
The code above
'***************** Code Start **************
is an example on how to call the Open Save dialog.
0
thenelsonCommented:
The Function TestIt() in the link shows another example for calling the Open Save dialog.
0
mlagrangeAuthor Commented:
Thanks, but the users will need the functionality of WE, rather than the Open/Save dialog.
The goal here is to show them all the pdf's that were just created in a mail merge process, and let them spot check various ones to confirm the mail merge worked ok.

The FileOpen dialog closes after selecting a single file, and they would have to keep opening it back up.

I have found sample code for the FileSearch object model (by Ken Getz, in the 2002 Developers Handbook).  Just as it is, it would display the files names in a list box, and I could Shell() on the double-click.

It would be so much easier to just open WE to a particular directory, with a wildcard filter in effect. I would have thought somebody would have worked up an API for the Windows Search Companion, but I have Google'd far & wide, and don't see anything like that...

 
0
thenelsonCommented:
Ah, forgot about that. It is very easy to load a listbox with filenames in a folder using the Dir Function.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.