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:
Public Enum ERECFileTypes SF_TEXT=1 SF_RTF=2 End Enum Private Function LoadDoc(ByVal sFile As String) As Boolean Dim eType As ERECFileTypes If sFile = "" Then If Not VBGetOpenFileName(sFile, , , , , , "RichText Documents (*.RTF)|*.RTF|Text Documents (*.TXT)|*.TXT|All Files (*.*)|*.*", 1, , "Choose File To Open", "RTF", Me.hWnd) Then Exit Function End If End If If pbDetectFileType(sFile, eType) Then If edtMain.LoadFromFile(sFile, eType) Then edtMain.Modified = False m_sFileName = sFile LoadDoc = True End If End If End Function




Reply With Quote