I'm using VB 6 on W2K Pro. When I set the cdlOFNExplorer flag in the common dialog open box code, I get an error that the flag is an unrecognized variable. Other flags work ok, and the numeric value, &H80000 for the flag works. Anyone know what's wrong? Thanks. Problem procedure code below.
PHP Code:Public Sub OpenFile()
On Error GoTo Cancel_Error
Dim pintCurrentDoc As Integer
With cdlText
' cdlOFNExplorer doesn''t work in next line
.Flags = &H80000 + cdlOFNPathMustExist + cdlOFNFileMustExist
.Filter = "Text Files (*.txt)|*.txt"
.FilterIndex = 1
.CancelError = True
.InitDir = App.Path
.ShowOpen
End With
pintCurrentDoc = GetFormIndex()
With Docs(pintCurrentDoc).frmCurrent
.Caption = MDIEdit.cdlText.FileTitle
.rtfText.LoadFile MDIEdit.cdlText.FileName
End With
Exit Sub
Cancel_Error:
Call MsgBox("Error!")
End Sub




Reply With Quote