Hi,

Can someone please explain what an Enumeration is and how it works, along with why you use it? This is relating to my use of the RichEdit control provided by VBAccelerator.com. I am trying to use the common dialog control to load a file without using advanced API calls.

Thanks,
Sal

VB Code:
  1. Public Enum ERECFileTypes
  2.     SF_TEXT=1
  3.     SF_RTF=2
  4. End Enum
  5.  
  6. Private Function LoadDoc(ByVal sFile As String) As Boolean
  7. Dim eType As ERECFileTypes
  8.  
  9.    If sFile = "" Then
  10.       If Not VBGetOpenFileName(sFile, , , , , , "RichText Documents (*.RTF)|*.RTF|Text Documents (*.TXT)|*.TXT|All Files (*.*)|*.*", 1, , "Choose File To Open", "RTF", Me.hWnd) Then
  11.          Exit Function
  12.       End If
  13.    End If
  14.    
  15.    If pbDetectFileType(sFile, eType) Then
  16.       If edtMain.LoadFromFile(sFile, eType) Then
  17.          edtMain.Modified = False
  18.          m_sFileName = sFile
  19.          LoadDoc = True
  20.       End If
  21.    End If
  22.    
  23. End Function