How to prompt user to select file?

Are there any similar code that could be used as "Application.GetOpenFilename" in Microstation?

I found it couldn't work.

Parents Reply
  • Thanks.

    Let me paste it for easy record.

    Private Declare Function mdlDialog_defFileOpen Lib "stdmdlbltin.dll" (ByVal fileName As String, ByVal rFileH As Long, ByVal dlogBoxId As Long, ByVal suggestedFileName As String, ByVal filterString As String, ByVal defaultDirectory As String, ByVal titleString As String, ByVal defaultFileId As Long, ByVal userPrefH As Long) As Long

    Sub ....()

    Dim oExcelpath As String

    oExcelpath = Space(1024)

       If mdlDialog_defFileOpen(oExcelpath, 0, 0, "MyFile", "*.xlsx", "D:\", "Select file for test", DEFDGNFILE_ID, 0) = 0 Then

           Debug.Print oExcelpath

       End If

    End Sub

Children
No Data