opening folder

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jenny

    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(strFol derName)) > 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
  • vic

    #2
    Re: opening folder

    Try

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

    vic

    Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!



    jenn@onlink.net (jenny) wrote in message news:<3d8589ad. 0308080525.3127 11ba@posting.go ogle.com>...[color=blue]
    > 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(strFol derName)) > 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[/color]

    Comment

    • JP

      #3
      Re: opening folder

      Try the Windows API function ShellExecute. There is a nice samle at here...




      jenn@onlink.net (jenny) wrote in message news:<3d8589ad. 0308080525.3127 11ba@posting.go ogle.com>...[color=blue]
      > 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(strFol derName)) > 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[/color]

      Comment

      Working...