|
-
Nov 3rd, 2002, 05:44 PM
#1
Thread Starter
Lively Member
cdlOFNExplorer doesn't work
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
-
Nov 3rd, 2002, 05:55 PM
#2
Frenzied Member
VB Code:
On Error GoTo Cancel_Error
Dim pintCurrentDoc As Integer
With cdlText
.Flags = &H80000 + cdlOFNPathMustExist + cdlOFNFileMustExist
.Filter = "Text Files (*.txt)|*.txt"
.FilterIndex = 1
.CancelError = True
.InitDir = App.Path
.ShowOpen
End With
This block works perfectly for me. What OS & service pack are you on?
-
Nov 3rd, 2002, 06:29 PM
#3
The picture isn't missing
he said that &H80000 DID work, but using cdlOFNExplorer didn't work.
maybe try putting it as a constant:
const cdlOFNExplorer = &H80000
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Nov 3rd, 2002, 06:36 PM
#4
Frenzied Member
Check the FileOpenConstants in the Object Browser, too.
-
Nov 3rd, 2002, 08:08 PM
#5
Thread Starter
Lively Member
Well, it doesn't show up in Object Browser. I could define a constant or use the numeric, but why isn't it there? It's VB 6, service pack 5.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|