|
-
Oct 6th, 2000, 10:11 AM
#1
Thread Starter
Member
Hello all,
can someone tell me what I'm doing wrong? I'm trying to display a CommonDialog1 for the user to select a file and the code that I'm using works because I tested it however, when I place it in my program it doesn't work and gives me the following error: "Object Required"
======================
Here's my code
--------------
Private Sub cmdBrowsePDFFile_Click()
On Error Resume Next
With CommonDialog1
.CancelError = True
.DialogTitle = "Testing Browse"
.Filter = "*.pdf"
.flags = cdlOFNHideReadOnly + cdlOFNFileMustExist
.ShowOpen
If Err = cdlCancel Then
Exit Sub
End If
txtPDFFile.Text = .FileName
End With
ErrHandler:
' User pressed the Cancel button
End Sub
============================
My modules:
-----------
Option Explicit
Public Type BrowseInfo
hwndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
Public Const BIF_RETURNONLYFSDIRS = 1
Public Const MAX_PATH = 260
Public Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
Public Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Public Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Public Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
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
|