Results 1 to 5 of 5

Thread: What file name did user enter in dialog box?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Posts
    29

    What file name did user enter in dialog box?

    I have this coding:

    strSaveToPath = Application.GetSaveAsFilename("C:\A.txt", fileFilter:="Text Files (*.txt), *.txt")

    This brings up a dialog box with C:\A.txt as default file in the File Name box.

    Later I use this code to run a slideshow:

    Shell "D:/Program Files\Irfanview\i_view32.exe /slideshow=C:\a.txt", vbNormalFocus

    All is well if user accepted C:\a.txt default. But how can i tell what file user selected if other than default so I can change it in the shell code?

  2. #2
    Addicted Member aldinator's Avatar
    Join Date
    May 2002
    Location
    Canada - better than all the rest!
    Posts
    216
    what is application.GetSaveAsFilename??
    i can't use that on my comp

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Application.GetSaveAsFileName is a method of the Excel automation server.

    The method returns the file name the user has chosen, which you are storing in your strSaveToPath variable. Would you not use that variable in your call to the shell method

    Shell "D:/Program Files\Irfanview\i_view32.exe /slideshow=" & strSaveToPath, vbNormalFocus

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Posts
    29
    It brings up a dialog box from which you can chose (browse) a file name to "Save As".

    Google

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Posts
    29
    brucevde
    Yes, your suggestion worked like a charm. I have been on this project since June. This was the final piece of the puzzle. Thanks to all who responded,

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