471,083 Members | 1,073 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,083 software developers and data experts.

opening folder

Is there a way to have the "work" folder open up and displayed after
the move is made in this code which uses the name statement to move
and rename folders from backup folders to a work folder?

snip ....
Dim strFolderName As String, strPath1 As String, strPath2 As String
Dim intLoop As Integer
On Error Resume Next
strFolderName = InputBox("Enter Folder Name")
If Len(Trim(strFolderName)) > 0 Then
For intLoop = Asc("c") To Asc("z")
strPath1 = Chr$(intLoop) & ":\backup\" & "ab" &
strFolderName & "12"
strPath2 = Chr$(intLoop) & ":\work\" & strFolderName
If Err.Number = 52 Then GoTo skipDrive
Name strPath1 As strPath2
MsgBox "Success"
I thought shell might do it but how would it start Chr$(intLoop) &
":\work\ ?

jenn
Jul 17 '05 #1
2 8730
vic
Try

Shell "explorer.exe " & Chr$(intLoop) & ":\work\", vbNormalFocus

vic

http://groups.yahoo.com/group/WinTips-Tricks/
je**@onlink.net (jenny) wrote in message news:<3d**************************@posting.google. com>...
Is there a way to have the "work" folder open up and displayed after
the move is made in this code which uses the name statement to move
and rename folders from backup folders to a work folder?

snip ....
Dim strFolderName As String, strPath1 As String, strPath2 As String
Dim intLoop As Integer
On Error Resume Next
strFolderName = InputBox("Enter Folder Name")
If Len(Trim(strFolderName)) > 0 Then
For intLoop = Asc("c") To Asc("z")
strPath1 = Chr$(intLoop) & ":\backup\" & "ab" &
strFolderName & "12"
strPath2 = Chr$(intLoop) & ":\work\" & strFolderName
If Err.Number = 52 Then GoTo skipDrive
Name strPath1 As strPath2
MsgBox "Success"
I thought shell might do it but how would it start Chr$(intLoop) &
":\work\ ?

jenn

Jul 17 '05 #2
JP
Try the Windows API function ShellExecute. There is a nice samle at here...
http://www.mvps.org/vbnet/index.html...ellexecute.htm

je**@onlink.net (jenny) wrote in message news:<3d**************************@posting.google. com>...
Is there a way to have the "work" folder open up and displayed after
the move is made in this code which uses the name statement to move
and rename folders from backup folders to a work folder?

snip ....
Dim strFolderName As String, strPath1 As String, strPath2 As String
Dim intLoop As Integer
On Error Resume Next
strFolderName = InputBox("Enter Folder Name")
If Len(Trim(strFolderName)) > 0 Then
For intLoop = Asc("c") To Asc("z")
strPath1 = Chr$(intLoop) & ":\backup\" & "ab" &
strFolderName & "12"
strPath2 = Chr$(intLoop) & ":\work\" & strFolderName
If Err.Number = 52 Then GoTo skipDrive
Name strPath1 As strPath2
MsgBox "Success"
I thought shell might do it but how would it start Chr$(intLoop) &
":\work\ ?

jenn

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Giuseppe D'Elia | last post: by
2 posts views Thread by srik | last post: by
2 posts views Thread by Dan Sikorsky | last post: by
2 posts views Thread by Jl_G_0 | last post: by
10 posts views Thread by kimiraikkonen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.