Results 1 to 5 of 5

Thread: cdlOFNExplorer doesn't work

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Location
    Michigan
    Posts
    107

    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 

  2. #2
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    VB Code:
    1. On Error GoTo Cancel_Error
    2.   Dim pintCurrentDoc As Integer
    3.   With cdlText
    4.     .Flags = &H80000 + cdlOFNPathMustExist + cdlOFNFileMustExist
    5.     .Filter = "Text Files (*.txt)|*.txt"
    6.     .FilterIndex = 1
    7.     .CancelError = True
    8.     .InitDir = App.Path
    9.     .ShowOpen
    10.   End With

    This block works perfectly for me. What OS & service pack are you on?
    Please rate my post.

  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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 .

  4. #4
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    Check the FileOpenConstants in the Object Browser, too.
    Please rate my post.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Location
    Michigan
    Posts
    107
    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
  •  



Click Here to Expand Forum to Full Width