Open File / Folder Dialog

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

    Open File / Folder Dialog

    Can anyone let me have the code for opening the open file dialog box and
    getting either a file or folder name as the output.

    I suspect it will look like

    Function GetPathOrFile(I nputPath as String) As String
    ......
    End function

    I seem to be able to get one or the other, but not both Files and Folders. I
    need to get the full path

    TIA

    Phil


  • Allen Browne

    #2
    Re: Open File / Folder Dialog

    For the Windows FileOpen/Save dialog, see:


    For the folder browse dialog, see:


    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Phil Stanton" <discussion@sta ntonfamily.co.u k> wrote in message
    news:4166b86f$0 $108$65c69314@m ercury.nildram. net...[color=blue]
    > Can anyone let me have the code for opening the open file dialog box and
    > getting either a file or folder name as the output.
    >
    > I suspect it will look like
    >
    > Function GetPathOrFile(I nputPath as String) As String
    > .....
    > End function
    >
    > I seem to be able to get one or the other, but not both Files and Folders.
    > I need to get the full path[/color]


    Comment

    • Phil Stanton

      #3
      Re: Open File / Folder Dialog

      Thanks Allen for that, however they are not doing what is required.

      The problem seems to be that api0001.htm only returns a file name
      (together with its path), while api0001.htm returns a path name but doesn't
      show any files. In addition there is no starting folder.

      Any other thoughts would be gratefully received

      Phil


      "Allen Browne" <AllenBrowne@Se eSig.Invalid> wrote in message
      news:4166be69$0 $1285$5a62ac22@ per-qv1-newsreader-01.iinet.net.au ...[color=blue]
      > For the Windows FileOpen/Save dialog, see:
      > http://www.mvps.org/access/api/api0001.htm
      >
      > For the folder browse dialog, see:
      > http://www.mvps.org/access/api/api0002.htm
      >
      > --
      > Allen Browne - Microsoft MVP. Perth, Western Australia.
      > Tips for Access users - http://allenbrowne.com/tips.html
      > Reply to group, rather than allenbrowne at mvps dot org.
      >
      > "Phil Stanton" <discussion@sta ntonfamily.co.u k> wrote in message
      > news:4166b86f$0 $108$65c69314@m ercury.nildram. net...[color=green]
      >> Can anyone let me have the code for opening the open file dialog box and
      >> getting either a file or folder name as the output.
      >>
      >> I suspect it will look like
      >>
      >> Function GetPathOrFile(I nputPath as String) As String
      >> .....
      >> End function
      >>
      >> I seem to be able to get one or the other, but not both Files and
      >> Folders. I need to get the full path[/color]
      >
      >[/color]


      Comment

      • Allen Browne

        #4
        Re: Open File / Folder Dialog

        Not sure I understand the issue.

        The reference at:

        has recently been updated so it does allow a starting folder.

        If you don't like the API calls, there is a FileDialog object in Access 2002
        and 2003, but it's not very good. It requires an extra library reference,
        does not work for Save As (even though it appears to offer that choice), and
        does not work at all in the runtime.

        --
        Allen Browne - Microsoft MVP. Perth, Western Australia.
        Tips for Access users - http://allenbrowne.com/tips.html
        Reply to group, rather than allenbrowne at mvps dot org.

        "Phil Stanton" <discussion@sta ntonfamily.co.u k> wrote in message
        news:4166cf26$0 $109$65c69314@m ercury.nildram. net...[color=blue]
        > Thanks Allen for that, however they are not doing what is required.
        >
        > The problem seems to be that api0001.htm only returns a file name
        > (together with its path), while api0001.htm returns a path name but
        > doesn't show any files. In addition there is no starting folder.
        >
        > Any other thoughts would be gratefully received
        >
        > Phil
        >
        >
        > "Allen Browne" <AllenBrowne@Se eSig.Invalid> wrote in message
        > news:4166be69$0 $1285$5a62ac22@ per-qv1-newsreader-01.iinet.net.au ...[color=green]
        >> For the Windows FileOpen/Save dialog, see:
        >> http://www.mvps.org/access/api/api0001.htm
        >>
        >> For the folder browse dialog, see:
        >> http://www.mvps.org/access/api/api0002.htm
        >>
        >>
        >> "Phil Stanton" <discussion@sta ntonfamily.co.u k> wrote in message
        >> news:4166b86f$0 $108$65c69314@m ercury.nildram. net...[color=darkred]
        >>> Can anyone let me have the code for opening the open file dialog box and
        >>> getting either a file or folder name as the output.
        >>>
        >>> I suspect it will look like
        >>>
        >>> Function GetPathOrFile(I nputPath as String) As String
        >>> .....
        >>> End function
        >>>
        >>> I seem to be able to get one or the other, but not both Files and
        >>> Folders. I need to get the full path[/color][/color][/color]


        Comment

        • Tim Marshall

          #5
          Re: Open File / Folder Dialog

          Phil Stanton wrote:
          [color=blue]
          > The problem seems to be that api0001.htm only returns a file name
          > (together with its path), while api0001.htm returns a path name but doesn't
          > show any files. In addition there is no starting folder.[/color]

          Both work fine for me in A97 and A2003. You can fiddle with the
          strFilter value in the function GetOpenFile to show any and whatever
          files you want.

          --
          Tim - http://www.ucs.mun.ca/~tmarshal/
          ^o<
          /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
          /^^ "What's UP, Dittoooooo?" - Ditto

          Comment

          • Douglas J. Steele

            #6
            Re: Open File / Folder Dialog

            "Tim Marshall" <TIMMY!@antarct ic.flowerpots> wrote in message
            news:ck6loi$6vj $1@coranto.ucs. mun.ca...[color=blue]
            > Phil Stanton wrote:
            >[color=green]
            > > The problem seems to be that api0001.htm only returns a file name
            > > (together with its path), while api0001.htm returns a path name but[/color][/color]
            doesn't[color=blue][color=green]
            > > show any files. In addition there is no starting folder.[/color]
            >
            > Both work fine for me in A97 and A2003. You can fiddle with the
            > strFilter value in the function GetOpenFile to show any and whatever
            > files you want.[/color]


            I think what Phil's looking for is a single interface that will let you
            choose either a file or a folder. I don't believe that such an interface
            exists as an API.

            --
            Doug Steele, Microsoft Access MVP

            (no e-mails, please!)





            Comment

            Working...