i have code that extracts the project name and opens explorer to the project direcotry. is there a way to get the explorer window to appear with focus, on top of the ACAD window?
the code (below) opens the directory, but it opens at the bottom of the stack. how do i bring the explorer window to the front?
thanx
Private Sub cmdBrowse_Click()
'Declare variables
Dim strYearFolder As String
Dim lngPos As Long
Dim ProjNum As String
Dim strDwgName As String
Dim path As String
Dim windowHandle As Long
'get project number / path
strDwgName = ThisDrawing.Name
lngPos = InStr(1, strDwgName, "_", vbTextCompare)
If lngPos > 0 Then
ProjNum = Left$(strDwgName, lngPos - 1)
strYearFolder = Left$(ProjNum, 2)
Select Case strYearFolder
Case "05"
path = " m:\2005\" & ProjNum
Case "06"
path = "m:\2006\" & ProjNum
Case "01"
path = "m:\2001\" & ProjNum
Case "02"
path = "M:\2002\" & ProjNum
Case "03"
path = "m:\2003\" & ProjNum
Case "04"
path = "m:\2004\" & ProjNum
Case "07"
path = "m:\2007\" & ProjNum
Case Else
path = "m:\1965-1999\" & ProjNum
End Select
Shell ("c:\windows\explorer.exe" & path)
Else
MsgBox "You cannot use this feature unless the drawing name is per MEI Standard", , "McBride Engineering"
End If
windowHandle = FindWindow(vbNullString, path)
SetWindowPos windowHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW
SendMessage windowHandle, TCM_SETCURFOCUS, 0, ByVal 0&
End Sub