none
which file is selected (has been clicked on ) by the user in a folder RRS feed

  • Question


  • i have a program that generates names for scanned files.
    the user will scann a file , and it will get scanned and put in a certain folder by the scanner . . .  (always the same folder)
    the user then opens the folder and selects the scanned file.

    is there an Api or some VBA coding to tell which file the user has selected.(highlighted or clicked upon)

    many thanks in advance

    Monday, January 13, 2014 9:32 PM

All replies

  • Dim fd As FileDialog
    Set fd = Application.FileDialog(msoFileDialogFilePicker)
    With fd
       If .Show = -1 Then
           MsgBox .SelectedItems(1)
       Else
           MsgBox "User pressed Cancel."
       End If
    End With
    Set fd = Nothing

    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org

    Tuesday, January 14, 2014 1:50 AM
  • Thanks for the reply Doug, but I am trying to do it without Filedialog.

    to explain properly, the user scanns a file then opens the folder were the file is scanned.

    I click a button in my program and i want the code in that button to go to the folder were the file is scanned

    and check which file the user has clicked or selected.

    is there an API or  vba coding to do that?. . . . nol filedialog is to be used

    regards

    Tuesday, January 14, 2014 7:17 PM