Results 1 to 2 of 2

Thread: MRU (Most Recently Used) List

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    MRU (Most Recently Used) List

    Code:
    Private Sub mnuFileMRU_Click(index As Integer)
    
           strFileNewName1 = (Left(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "\DAF")) & "Map\")
        strFileNewName2 = (Mid(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "MY"), 8) & ".bmp")
        strFileNewName3 = strFileNewName1 & strFileNewName2
    
            Picture1.Picture = LoadPicture(strFileNewName3)       
      Call ConvertMRU
       Call ENCExtractMRU
       Call setScale
       
        blnOkToMove = True
     
    End Sub
    i used the code above and came out an error "path not found" (point to line in red color)when i click the MRU list but when that file not in that directory.

    how to add code to above to avoid that kind of error occur and also instead it by a message box to let user know that the file is not find and please try select again.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: MRU (Most Recently Used) List

    vb Code:
    1. Private Sub mnuFileMRU_Click(index As Integer)
    2. On Error GoTo ErrTrap
    3.  
    4.  
    5.        strFileNewName1 = (Left(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "\DAF")) & "Map\")
    6.     strFileNewName2 = (Mid(mnuFileMRU(index).Caption, InStr(1, mnuFileMRU(index).Caption, "MY"), 8) & ".bmp")
    7.     strFileNewName3 = strFileNewName1 & strFileNewName2
    8.  
    9.         Picture1.Picture = LoadPicture(strFileNewName3)      
    10.   Call ConvertMRU
    11.    Call ENCExtractMRU
    12.    Call setScale
    13.    
    14.     blnOkToMove = True
    15. Exit Sub
    16. ErrTrap:
    17. Select Case Err.Number
    18.      Case (I don't remember the error number for path not found)
    19.           Msgbox "The selected file is not found in that path."
    20.      Case Else
    21.           Msgbox "An Error has occurred.   It is " & Err.Number & " " & Err.Description
    22. End Select
    23. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width