go to folder

  • Thread starter Thread starter Joel
  • Start date Start date
J

Joel

Public custom task form -

I have used the Microsoft Script Runtime to automatically create a folder in windows with this set of commands:

Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder("c:\New Folder")
CreateFolderDemo = f.Path

It works great - but now, I want to create a button in my custom form that goes to that specific folder. Does anybody have any sample code? I did not see anything in the Script Runtime library that would help me out.

Thanks - Joel
 
What do you mean by "goes to that specific folder"?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Public custom task form -

I have used the Microsoft Script Runtime to automatically create a folder in
windows with this set of commands:

Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder("c:\New Folder")
CreateFolderDemo = f.Path

It works great - but now, I want to create a button in my custom form that
goes to that specific folder. Does anybody have any sample code? I did not
see anything in the Script Runtime library that would help me out.

Thanks - Joel
 
You could use a shell execute to run "C:\Monkey\" or do much the same thing
more elegantly with IE:

Set objWeb = CreateObject("InternetExplorer.Application")
objWeb.Navigate "C:\Data"
objWeb.Visible = True
 
Hi Joel,

here is a sample for the shell:

Public Function OpenWindowsExplorer(sStartDir As String, _
Optional ByVal bWithNavigationPane As Boolean = True, _
Optional ByVal eWindowStyle As VBA.VbAppWinStyle = vbNormalFocus _
) As Double
Select Case bWithNavigationPane
Case True
OpenWindowsExplorer = Shell("Explorer.exe /n, /e, " & sStartDir,
eWindowStyle)
Case Else
OpenWindowsExplorer = Shell("Explorer.exe /n, " & sStartDir,
eWindowStyle)
End Select
End Function
 
Back
Top