In article <14**************************@posting.google.com >,
da**********@bigpond.com.au (DD) writes:
Hi
I want to click a cmdButton that opens up the Microsoft Default Search
box, so a user can search their harddrive for files
Can anyone offer help on the code
Regards
David
You can quite easily use the Windows File Open/Save dialog box. The code for
this is located at
http://www.mvps.org/access/api/api0001.htm. Whilst this code
is quite complicated, you can just treat it as a "black box", by modifying the
sample function provided at the bottom of the page.
If you are after the proper File Search facility of Windows Explorer, then you
will need to do a bit of work. The code example below is based on code from
Randy Birch's VBnet at
http://vbnet.mvps.org:
Private Const VK_ACTION = &H46
Private Const VK_LWIN = &H5B
Private Const KEYEVENTF_KEYUP = &H2
Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
Private Sub sFileSearch()
Call keybd_event(VK_LWIN, 0, 0, 0)
Call keybd_event(VK_ACTION, 0, 0, 0)
Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
End Sub
--
Jon
www.applecore99.com - Access Tips and Tricks