Solved

GetOpenFileName Problem

Posted on 2004-03-24
13
915 Views
Last Modified: 2013-12-25
Hi experts,

I am new at this and would really appreciate if you can help me with the problem below.  

here is the code...

Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameW" (pOpenFileName As OPENFILENAME) As Long

Type OPENFILENAME
        lStructSize As Long
        hwndOwner As Long
        hInstance As Long
        lpstrFilter As String
        lpstrCustomFilter As String
        nMaxCustFilter As Long
        nFilterIndex As Long
        lpstrFile As String
        nMaxFile As Long
        lpstrFileTitle As String
        nMaxFileTitle As Long
        lpstrInitialDir As String
        lpstrTitle As String
        flags As Long
        nFileOffset As Integer
        nFileExtension As Integer
        lpstrDefExt As String
        lCustData As Long
        lpfnHook As Long
        lpTemplateName As String
End Type


Dim openFile As OPENFILENAME

Function GetOpenFile()

    Dim APIResults As Long
    Dim sFilter As String
'I don't know what goes next here, but  I want it to return the filepath AND the filename.  I don't want to filter out any files (I want to view all of the files).  Hope I don't confused you.    

End Function


Thanks guys.
Bing

0
Comment
Question by:JamesBing
  • 3
  • 2
  • 2
  • +5
13 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 200 total points
ID: 10673790
Go here http://www.mentalis.org/apilist/GetOpenFileName.shtml and click on the "Open Dialog" link at the bottom of the page in the examples section.  There is also an example for common dialogs that you may find useful.

Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    lpstrFilter As String
    lpstrCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    lpstrFile As String
    nMaxFile As Long
    lpstrFileTitle As String
    nMaxFileTitle As Long
    lpstrInitialDir As String
    lpstrTitle As String
    flags As Long
    nFileOffset As Integer
    nFileExtension As Integer
    lpstrDefExt As String
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End Type
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim OFName As OPENFILENAME
    OFName.lStructSize = Len(OFName)
    'Set the parent window
    OFName.hwndOwner = Me.hWnd
    'Set the application's instance
    OFName.hInstance = App.hInstance
    'Select a filter
    OFName.lpstrFilter = "Text Files (*.txt)" + Chr$(0) + "*.txt" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
    'create a buffer for the file
    OFName.lpstrFile = Space$(254)
    'set the maximum length of a returned file
    OFName.nMaxFile = 255
    'Create a buffer for the file title
    OFName.lpstrFileTitle = Space$(254)
    'Set the maximum length of a returned file title
    OFName.nMaxFileTitle = 255
    'Set the initial directory
    OFName.lpstrInitialDir = "C:\"
    'Set the title
    OFName.lpstrTitle = "Open File - KPD-Team 1998"
    'No flags
    OFName.flags = 0

    'Show the 'Open File'-dialog
    If GetOpenFileName(OFName) Then
        MsgBox "File to Open: " + Trim$(OFName.lpstrFile)
    Else
        MsgBox "Cancel was pressed"
    End If
End Sub
0
 

Author Comment

by:JamesBing
ID: 10673849
what's Me.Hwnd?  I got a compile error of Invalid use of Me Keyword

Bing
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 10673998
Me.hWnd is a handle to the current forms window.  Try creating a new project and pasting that code in to see how it works.

Idle_Mind
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 10674634
or try replace Me.hWnd with 0& , if there is not handle ?
0
 

Expert Comment

by:Pentabyte
ID: 10675814
I was using Access 97 and didn't need to assign any value to "OFName.hwndOwner". I think, "OFName.hInstance" is optional, too.

cheers, Pentabyte
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10676295
Why don't you use CommonDialog ?
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 27

Expert Comment

by:Ark
ID: 10683046
0
 

Assisted Solution

by:Don-Acme
Don-Acme earned 100 total points
ID: 10767218
try it once this way here....

This here comes into the declarations
----------------------------------------------------------------------
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (lpofn As OPENFILENAME) As Long
 
Private Type OPENFILENAME
   lStructSize As Long
   hwndOwner As Long
   hInstance As Long
   lpstrFilter As String
   lpstrCustomFilter As String
   nMaxCustomFilter As Long
   nFilterIndex As Long
   lpstrFile As String
   nMaxFile As Long
   lpstrFileTitle As String
   nMaxFileTitle As Long
   lpstrInitialDir As String
   lpstrTitle As String
   flags As Long
   nFileOffset As Integer
   nFileExtension As Integer
   lpstrDefExt As String
   lCustData As Long
   lpfnHook As Long
   lpTemplateName As String
End Type

Private Const OFN_ENABLE_CREATE_PROMPT = &H2000
Private Const OFN_ENABLE_MULTISELECT = &H200
Private Const OFN_ENABLE_HOOK = &H20
Private Const OFN_ENABLE_SIZING = &H800000
Private Const OFN_ENABLE_TEMPLATES = &H40
Private Const OFN_ENABLE_TEMPLATEHANDLE = &H80
Private Const OFN_ENABLE_EXPLORER_STYLE = &H80000
Private Const OFN_ENABLE_DIFFERENT_EXTENSION = &H400
Private Const OFN_ENABLE_REFERENCED_FILELINKS = &H100000
Private Const OFN_ENABLE_LONG_FILENAMES = &H200000
Private Const OFN_ENABLE_OPEN_AS_READONLY = &H1
Private Const OFN_ENABLE_PATH_MUST_EXIST = &H800
Private Const OFN_ENABLE_FILE_MUST_EXIST = &H1000
Private Const OFN_ENABLE_HIDE_READONLY_FILES = &H4
Private Const OFN_ENABLE_OVERWRITE_PROMPT = &H2
Private Const OFN_ENABLE_HELP_BUTTON = &H10
Private Const OFN_ENABLE_IGNORE_SHARED_FILE_AWARENESS = &H4000
Private Const OFN_DISABLE_DIRECTORY_CHANGE = &H8
Private Const OFN_DISABLE_LONG_FILENAMES = &H40000
Private Const OFN_DISABLE_NETWORK_BUTTON = &H20000
Private Const OFN_DISABLE_READONLY_RETURN = &H8000
Private Const OFN_DISABLE_CREATION_OF_TESTFILE = &H10000
Private Const OFN_DISABLE_FILENAME_VALIDATION = &H100
----------------------------------------------------------------------
your function goes here
----------------------------------------------------------------------
Private Function OpenFileDialog() As String

                        Dim tpyOpen As OPENFILENAME
                        Dim lngRetval As Long
                        Dim blnRetrievalIsNull As Boolean
                       
    With tpyOpen
        .lStructSize = Len(tpyOpen)
        .flags = OFN_ENABLE_SIZING Or OFN_ENABLE_EXPLORER_STYLE Or OFN_ENABLE_LONG_FILENAMES Or OFN_ENABLE_PATH_MUST_EXIST Or OFN_ENABLE_FILE_MUST_EXIST
        .lpstrTitle = "Open..." & vbNullChar
        .lpstrFilter = "All Files" & vbNullChar & "*.*" & vbNullChar
        .nFilterIndex = 1
        .lpstrFile = Space(1024) & vbNullChar
        .nMaxFile = Len(.lpstrFile)
        .lpstrFileTitle = Space(1024) & vbNullChar
        .nMaxFileTitle = Len(.lpstrFileTitle)
        .lpstrInitialDir = "C:\" & vbNullChar
       
    End With
       
    lngRetval = GetOpenFileName(tpyOpen)
    OpenFileDialog = Trim(tpyOpen.lpstrFile)
                           ' if you want to do a multiselect you will need to edit the output you get
    blnRetrievalIsNull = lngRetval = 0
    If blnRetrievalIsNull Then
        Exit Function
       
    End If
   
End Function
----------------------------------------------------------------------
0
 

Expert Comment

by:0MoJoH
ID: 12283978
In response to Don-Acme's code,

I get the OpenDialog but the selected file doesn't open...
I copied-pasted the code in a new module and "call" it from a click event in Excel 97.
0
 

Expert Comment

by:Don-Acme
ID: 12284475
Hi 0MoJoH,

I checked my code and actually it should be working fine on any type of Windows.

I extended the code alot and I've created a very simple class for the use within our company so that nobody has to rewrite it... I'm still looking for the documentation since I've saved it somewhere and I cannot find it...

Hope you can use this code here:

PS: the lines that are set to Remarks are really not necessary for a simple Excel application.
PSPS: this code should be more a guideline to write your own it is definetly not the best you can get


Usage:
--------
1. Create a new class in excel, VB or whatever
2. paste the source code into the class
3. You can leave the default settings for the properties
4. try if you can open any file you need to.


Source Code:
--------------------------------------------------------------------------

Option Explicit
                       
                        Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
                                                "GetOpenFileNameA" (lpofn As OPENFILENAME) As Long
                                               
                        Private Declare Function GetSaveFileName Lib "comdlg32.dll" Alias _
                                                "GetSaveFileNameA" (lpofn As OPENFILENAME) As Long

                        Private Type OPENFILENAME
                           lStructSize As Long
                           hwndOwner As Long
                           hInstance As Long
                           lpstrFilter As String
                           lpstrCustomFilter As String
                           nMaxCustomFilter As Long
                           nFilterIndex As Long
                           lpstrFile As String
                           nMaxFile As Long
                           lpstrFileTitle As String
                           nMaxFileTitle As Long
                           lpstrInitialDir As String
                           lpstrTitle As String
                           flags As Long
                           nFileOffset As Integer
                           nFileExtension As Integer
                           lpstrDefExt As String
                           lCustData As Long
                           lpfnHook As Long
                           lpTemplateName As String
                           
                        End Type
                       
                        Enum OFN_FLAGS
                            OFN_ENABLE_CREATE_PROMPT = &H2000
                            OFN_ENABLE_MULTISELECT = &H200
                            OFN_ENABLE_HOOK = &H20
                            OFN_ENABLE_SIZING = &H800000
                            OFN_ENABLE_TEMPLATES = &H40
                            OFN_ENABLE_TEMPLATEHANDLE = &H80
                            OFN_ENABLE_EXPLORER_STYLE = &H80000
                            OFN_ENABLE_DIFFERENT_EXTENSION = &H400
                            OFN_ENABLE_REFERENCED_FILELINKS = &H100000
                            OFN_ENABLE_LONG_FILENAMES = &H200000
                            OFN_ENABLE_OPEN_AS_READONLY = &H1
                            OFN_ENABLE_PATH_MUST_EXIST = &H800
                            OFN_ENABLE_FILE_MUST_EXIST = &H1000
                            OFN_ENABLE_HIDE_READONLY_FILES = &H4
                            OFN_ENABLE_OVERWRITE_PROMPT = &H2
                            OFN_ENABLE_HELP_BUTTON = &H10
                            OFN_ENABLE_IGNORE_SHARED_FILE_AWARENESS = &H4000
                            OFN_DISABLE_DIRECTORY_CHANGE = &H8
                            OFN_DISABLE_LONG_FILENAMES = &H40000
                            OFN_DISABLE_NETWORK_BUTTON = &H20000
                            OFN_DISABLE_READONLY_RETURN = &H8000
                            OFN_DISABLE_CREATION_OF_TESTFILE = &H10000
                            OFN_DISABLE_FILENAME_VALIDATION = &H100
                           
                        End Enum
                       
                        Dim m_strDefaultInitialDrive As String
                        Dim m_strDefaultOpenFileTitle As String
                        Dim m_strDefaultSaveFileTitle As String
                        Dim m_strDefaultFileType As String
                        Dim m_hexOpenFileFlags
                        Dim m_hexSaveFileFlags
                        Dim m_lngDefaultWindowHandle As Long
                        Dim m_lngDefaultExtensionIndex As Long
                        Dim m_lngDefaultEmptyStringForFile As Long
                       
                       
                       

Public Property Let DefaultInitialDrive(ByVal strDefaultInitialDrive As String)
                       
                        Dim blnIsNotDrive As Boolean
                       
                       
   
    blnIsNotDrive = InStr(strDefaultInitialDrive, ":\") = 0
    If blnIsNotDrive Then
        strDefaultInitialDrive = "C:\" & vbNullChar
       
    End If
    m_strDefaultInitialDrive = strDefaultInitialDrive & vbNullChar
   
End Property

Public Property Get DefaultInitialDrive() As String
   
    DefaultInitialDrive = Replace(m_strDefaultInitialDrive, vbNullChar, "")

End Property

Public Property Let DefaultOpenFileTitle(ByVal strDefaultOpenFileTitle As String)
    m_strDefaultOpenFileTitle = strDefaultOpenFileTitle & vbNullChar
   
End Property

Public Property Get DefaultOpenFileTitle() As String
    DefaultOpenFileTitle = Replace(m_strDefaultOpenFileTitle, vbNullChar, "")
   
End Property

Public Property Let DefaultSaveFileTitle(ByVal strDefaultSaveFileTitle As String)
    m_strDefaultSaveFileTitle = strDefaultSaveFileTitle & vbNullChar
   
End Property

Public Property Get DefaultSaveFileTitle() As String
    DefaultSaveFileTitle = Replace(m_strDefaultSaveFileTitle, vbNullChar, "")
   
End Property

Public Property Let DefaultFileType(ByVal strDefaultFileType As String)
                                   
                                    Dim strFileType() As String
                                    Dim strDescription As String
                                    Dim strExtension As String
                                   
                                    Dim i As Integer
                                    Dim j As Integer
                                   
                                   
           
    i = 0
    j = 1
    m_strDefaultFileType = ""
    strFileType = Split(strDefaultFileType, ";")
    Do Until j > UBound(strFileType)
        strDescription = strFileType(i)
        strExtension = strFileType(j)
       
        strExtension = Replace(strExtension, ".", "")
        strExtension = Replace(strExtension, "*", "")
        If strExtension = "" Then
            strExtension = "*.*"
       
        Else
            strExtension = "*." & strExtension
       
        End If
       
        m_strDefaultFileType = m_strDefaultFileType & strDescription & vbNullChar & strExtension
       
        If j <> UBound(strFileType) Then
            m_strDefaultFileType = m_strDefaultFileType & vbNullChar
           
        ElseIf j = UBound(strFileType) Then
            m_strDefaultFileType = m_strDefaultFileType & vbNullChar & vbNullChar
       
        End If
        i = i + 2
        j = j + 2
       
    Loop
   
End Property

Public Property Get DefaultFileType() As String
    DefaultFileType = Replace(m_strDefaultFileType, vbNullChar, ";")
   
End Property

Public Property Let OpenFileFlags(ByVal hexOpenFileFlags As OFN_FLAGS)
    m_hexOpenFileFlags = hexOpenFileFlags
   
End Property

Public Property Get OpenFileFlags() As OFN_FLAGS
    OpenFileFlags = m_hexOpenFileFlags

End Property

Public Property Let SaveFileFlags(ByVal hexSaveFileFlags As OFN_FLAGS)
    m_hexSaveFileFlags = hexSaveFileFlags
   
End Property

Public Property Get SaveFileFlags() As OFN_FLAGS
    SaveFileFlags = m_hexSaveFileFlags

End Property

Public Property Let DefaultWindowHandle(ByVal lngDefaultWindowHandle As Long)
    m_lngDefaultWindowHandle = lngDefaultWindowHandle
   
End Property

Public Property Get DefaultWindowHandle() As Long
    DefaultWindowHandle = m_lngDefaultWindowHandle
   
End Property

Public Property Let DefaultExtensionIndex(ByVal lngDefaultExtensionIndex As Long)
                       
                        Dim blnIndexIsLessThanOne As Boolean
                       
                       
                       
    If blnIndexIsLessThanOne = lngDefaultExtensionIndex < 1 Then
        lngDefaultExtensionIndex = 1
   
    End If
    m_lngDefaultExtensionIndex = lngDefaultExtensionIndex
   
End Property

Public Property Get DefaultExtensionIndex() As Long
    DefaultExtensionIndex = m_lngDefaultExtensionIndex
   
End Property

Public Property Let DefaultEmptyStringForFile(ByVal lngDefaultEmptyStringForFile As Long)
                       
                        Dim blnIndexIsLess As Boolean
                       
                       
                       
    If blnIndexIsLess = lngDefaultEmptyStringForFile < 256 Then
        lngDefaultEmptyStringForFile = 1024
   
    End If
    m_lngDefaultEmptyStringForFile = lngDefaultEmptyStringForFile
   
End Property

Public Property Get DefaultEmptyStringForFile() As Long
    DefaultEmptyStringForFile = m_lngDefaultEmptyStringForFile
   
End Property

Private Sub Class_Initialize()
    m_strDefaultInitialDrive = "C:\" & vbNullChar
    m_strDefaultOpenFileTitle = "Open" & vbNullChar
    m_strDefaultSaveFileTitle = "Save As..." & vbNullChar
    m_strDefaultFileType = "All Files" & vbNullChar & "*.*" & vbNullChar & vbNullChar
    m_hexOpenFileFlags = OFN_ENABLE_SIZING Or OFN_ENABLE_EXPLORER_STYLE Or OFN_ENABLE_LONG_FILENAMES Or _
                         OFN_ENABLE_PATH_MUST_EXIST Or OFN_ENABLE_FILE_MUST_EXIST
    m_hexSaveFileFlags = OFN_ENABLE_SIZING Or OFN_ENABLE_EXPLORER_STYLE Or OFN_ENABLE_LONG_FILENAMES Or _
                         OFN_ENABLE_PATH_MUST_EXIST Or OFN_ENABLE_FILE_MUST_EXIST Or _
                         OFN_ENABLE_OVERWRITE_PROMPT
    m_lngDefaultWindowHandle = 0
    m_lngDefaultExtensionIndex = 1
    m_lngDefaultEmptyStringForFile = 1024
   
End Sub

Public Function OpenFileDialog() As String

                        Dim lngRetval As Long
                       
                        Dim i As Integer
                       
                        Dim strFileNamesTmp As String
                        Dim strFileNames() As String
                        Dim strSemicolon As String
                       
                        Dim OFN As OPENFILENAME
                       
                       
   
    With OFN
        .lStructSize = Len(OFN)
        '.hInstance = App.hInstance
        .hwndOwner = m_lngDefaultWindowHandle
        .flags = m_hexOpenFileFlags
        .lpstrTitle = m_strDefaultOpenFileTitle
        .lpstrFilter = m_strDefaultFileType
        .nFilterIndex = m_lngDefaultExtensionIndex
        .lpstrFile = Space(m_lngDefaultEmptyStringForFile) & vbNullChar
        .nMaxFile = Len(.lpstrFile)
        .lpstrFileTitle = Space(m_lngDefaultEmptyStringForFile) & vbNullChar
        .nMaxFileTitle = Len(.lpstrFileTitle)
        .lpstrInitialDir = m_strDefaultInitialDrive
        '.lpfnHook = GetAddress(AddressOf HookFunc)
       
    End With
    lngRetval = GetOpenFileName(OFN)
    If lngRetval = 0 Then
        OpenFileDialog = ""
       
    Else
        strFileNames = Split(Trim(OFN.lpstrFile), vbNullChar & vbNullChar)
        If UBound(strFileNames) > 0 Then
            strFileNamesTmp = Left$(OFN.lpstrFile, InStr(1, OFN.lpstrFile, vbNullChar & vbNullChar) - 1)
            strFileNames = Split(Trim(strFileNamesTmp), vbNullChar)
            If UBound(strFileNames) = 0 Then
                GoTo EndSub
               
            End If
            i = 1
            strFileNamesTmp = ""
            Do Until i > UBound(strFileNames)
                Select Case UBound(strFileNames)
                Case Is = i
                    strSemicolon = ""
                   
                Case Else
                    strSemicolon = ";"
                   
                End Select
                strFileNamesTmp = strFileNamesTmp & Trim(strFileNames(0)) & _
                                                    Trim(strFileNames(i)) & _
                                                    strSemicolon
                i = i + 1
               
            Loop
       
        Else
            strFileNamesTmp = Left$(OFN.lpstrFile, InStr(1, OFN.lpstrFile, vbNullChar) - 1)
           
        End If
EndSub:
            OpenFileDialog = Trim(strFileNamesTmp)
           
    End If

End Function

Public Function SaveFileDialog() As String

                        Dim lngRetval As Long
                       
                        Dim strFileNamesTmp As String
                       
                        Dim OFN As OPENFILENAME
                       
                       
   
    With OFN
        .lStructSize = Len(OFN)
        '.hInstance = App.hInstance
        .hwndOwner = m_lngDefaultWindowHandle
        .flags = m_hexSaveFileFlags
        .lpstrTitle = m_strDefaultSaveFileTitle
        .lpstrFilter = m_strDefaultFileType
        .nFilterIndex = m_lngDefaultExtensionIndex
        .lpstrFile = Space(m_lngDefaultEmptyStringForFile) & vbNullChar
        .nMaxFile = m_lngDefaultEmptyStringForFile + 1
        .lpstrFileTitle = Space(m_lngDefaultEmptyStringForFile) & vbNullChar
        .nMaxFileTitle = m_lngDefaultEmptyStringForFile + 1
        .lpstrInitialDir = m_strDefaultInitialDrive
        '.lpfnHook = GetAddress(Address Of Hook Func)
       
    End With
    lngRetval = GetSaveFileName(OFN)
    If lngRetval = 0 Then
        SaveFileDialog = ""
       
    Else
        strFileNamesTmp = Left$(OFN.lpstrFile, InStr(1, OFN.lpstrFile, vbNullChar) - 1)
        SaveFileDialog = Trim(strFileNamesTmp)
       
    End If
   
End Function

--------------------------------------------------------------------------
0
 

Expert Comment

by:0MoJoH
ID: 12286552
Hi DOn-Acme,

Thanks for your help.
This updated code is 5 times harder to understand than the initial one that you posted.
I guess I will have a lot of fun decrypting your "simple" class.

Ok.

I created a new class and pasted the code source.
Now I have no idea how to use it.

I mean,... following JamesBing's idea, the objective was to allow the user to browse and open a file via a dialog box.

How do I call the OpenFile function from a button ?
Which variable will be containing the name of the file that has been selected by the user to open ?

My god I wish my company was using Excel 2003 instead of 97.........

0
 

Expert Comment

by:Don-Acme
ID: 12286734
Hey 0MoJoH,

there are some properties, that will let you set specific settings for your Open File Button

This procedure here:
contains the default settings when you call the class.
-------------------------------------------------
Private Sub Class_Initialize()
    m_strDefaultInitialDrive = "C:\" & vbNullChar
    m_strDefaultOpenFileTitle = "Open" & vbNullChar
    m_strDefaultSaveFileTitle = "Save As..." & vbNullChar
    m_strDefaultFileType = "All Files" & vbNullChar & "*.*" & vbNullChar & vbNullChar
    m_hexOpenFileFlags = OFN_ENABLE_SIZING Or OFN_ENABLE_EXPLORER_STYLE Or OFN_ENABLE_LONG_FILENAMES Or _
                         OFN_ENABLE_PATH_MUST_EXIST Or OFN_ENABLE_FILE_MUST_EXIST
    m_hexSaveFileFlags = OFN_ENABLE_SIZING Or OFN_ENABLE_EXPLORER_STYLE Or OFN_ENABLE_LONG_FILENAMES Or _
                         OFN_ENABLE_PATH_MUST_EXIST Or OFN_ENABLE_FILE_MUST_EXIST Or _
                         OFN_ENABLE_OVERWRITE_PROMPT
    m_lngDefaultWindowHandle = 0
    m_lngDefaultExtensionIndex = 1
    m_lngDefaultEmptyStringForFile = 1024
   
End Sub
-------------------------------------------------

The variable names are set to the same names as the properties you have.

-------------------------------------------------
To open a file use: OpenFileDialog
To save a file use: SaveFileDialog
-------------------------------------------------

-------------------------------------------------
The Enum "OFN_FLAGS" contains some settings for your window. I have chosen some settings
from the windows 2000 environment


regards...
The Don
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now