Results 1 to 9 of 9

Thread: last saved file path

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    4

    last saved file path

    In vb 6.0, how do I get a directly list box to display the last opened/saved file path. Any help is appreciated.

  2. #2
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: last saved file path

    You need to store the filename somewhere in a variable whenever you open/save a file.

    VB Code:
    1. Dim LastFileName As String
    2.  
    3. Sub OpenFile(FileName As String)
    4.     LastFileName = FileName
    5.     ' code to open file
    6. End Sub
    7.  
    8. Sub SaveFile(FileName As String)
    9.     LastFileName = FileName
    10.     ' code to save file
    11. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    4

    Re: last saved file path

    Thanks.. but I want it to remember after you close and reopen the program. I guess you would have to save it in an external file...

    (oops i guess ur code does do that :P)
    Last edited by thiheep; Nov 6th, 2006 at 09:54 AM.

  4. #4
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: last saved file path

    Or simply store it in the registry using the savesetting function
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

  5. #5
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: last saved file path

    What kind of an alternative do you want?
    What should it do that my example doesn't?

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    4

    Re: last saved file path

    how would i save it in the registry?? (I donno how)

  7. #7
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: last saved file path

    I don't have vb here.Heres how to do
    Type savesetting then hit space and it will show you the arguments.Use getsetting to retrieve the values
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

  8. #8

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    4

    Re: last saved file path

    Thanks guys. It worked :P

    VB Code:
    1. Call SaveSetting(App.EXEName, "SaveLastPath", "Open", dlstbox.path)

    VB Code:
    1. dlstbox.path = GetSetting(App.EXEName, "SaveLastPath", "Open", "")

  9. #9
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: last saved file path

    Mark your thread as resolved then and rate the posts you found useful if any
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

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