I've built db's for companies that also did not have the license to use the ocx controls. Here's what I used to open image files:
'Module declarations
Private cdlPath As String
Private cdlFileType As String
Public Const OFN_READONLY = &H1
Public Const OFN_OVERWRITEPROMPT = &H2
Public Const OFN_HIDEREADONLY = &H4
Public Const OFN_NOCHANGEDIR = &H8
Public Const OFN_SHOWHELP = &H10
Public Const OFN_ENABLEHOOK = &H20
Public Const OFN_ENABLETEMPLATE = &H40
Public Const OFN_ENABLETEMPLATEHANDLE = &H80
Public Const OFN_NOVALIDATE = &H100
Public Const OFN_ALLOWMULTISELECT = &H200
Public Const OFN_EXTENSIONDIFFERENT = &H400
Public Const OFN_PATHMUSTEXIST = &H800
Public Const OFN_FILEMUSTEXIST = &H1000
Public Const OFN_CREATEPROMPT = &H2000
Public Const OFN_SHAREAWARE = &H4000
Public Const OFN_NOREADONLYRETURN = &H8000
Public Const OFN_NOTESTFILECREATE = &H10000
Public Const OFN_NONETWORKBUTTON = &H20000
Public Const OFN_NOLONGNAMES = &H40000
Public Const OFN_EXPLORER = &H80000
Public Const OFN_NODEREFERENCELINKS = &H100000
Public Const OFN_LONGNAMES = &H200000
Public Const OFN_SHAREFALLTHROUGH = 2
Public Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
' API declarations
Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Public Declare Function GetWindowWord Lib "user32" _
(ByVal HWnd As Long, ByVal lngIndex As Long) As Long
'Methods
Public Function GetPicturePath(ByVal HWnd As Long, ByRef strPath As String) As Boolean
On Error GoTo PicError
Dim ofn As OPENFILENAME, rtnVal As Long
Dim slashPos As Integer, slashTemp As Integer
Dim strLocalPath As String, strNewFile As String
Dim strTempPath As String
ofn.lStructSize = Len(ofn)
ofn.hwndOwner = HWnd
ofn.hInstance = GetWindowWord(HWnd, GWW_HINSTANCE)
ofn.lpstrFilter = _
"All Bitmaps (*.bmp)" + Chr$(0) + "*.bmp" + Chr$(0) + _
"All Gifs (*.gif)" + Chr$(0) + "*.gif" + Chr$(0) + _
"All JPEGs (*.jpg)" + Chr$(0) + "*.jpg" + Chr$(0) + _
"All Metafiles (*.wmf)" + Chr$(0) + "*.wmf" + Chr$(0)
Select Case cdlFileType
Case "bmp", "BMP"
ofn.nFilterIndex = 1
Case "gif", "GIF"
ofn.nFilterIndex = 2
Case "jpg", "JPG"
ofn.nFilterIndex = 3
Case "wmf", "WMF"
ofn.nFilterIndex = 4
Case Else
' default
End Select
ofn.lpstrFile = Space$(254)
ofn.nMaxFile = 255
ofn.lpstrFileTitle = Space$(254)
ofn.nMaxFileTitle = 255
If cdlPath = "" Then
ofn.lpstrInitialDir = GetDBPath()
Else
ofn.lpstrInitialDir = cdlPath
End If
ofn.lpstrTitle = "Select Background Picture"
ofn.flags = OFN_HIDEREADONLY
rtnVal = GetOpenFileName(ofn)
If (rtnVal) Then
strPath = Trim(ofn.lpstrFile)
strPath = Mid(strPath, 1, Len(strPath) - 1) ' Trim NULL
slashTemp = InStr(1, strPath, "\"

While slashTemp > 0
slashTemp = InStr(slashPos + 1, strPath, "\"

If slashTemp > 0 Then slashPos = slashTemp
Wend
If Len(strPath) > 0 Then
cdlPath = Mid(strPath, 1, slashPos - 1)
cdlFileType = Right(strPath, 3)
End If
Select Case Left(strPath, 1)
Case "B", "F" To "Z"
' If network path, convert to UNC
strTempPath = Mid(strPath, 4)
strPath = GetNetPath(Left(strPath, 1))
strPath = strPath & strTempPath
Case "A", "C"
' If not network path, copy file to
' network drive and return UNC path
strLocalPath = strPath
strPath = GetNetPath(Left(CurrentDb.Name, 1))
strPath = strPath & Mid(GetDBPath(), 4)
strNewFile = GetFileName(strLocalPath)
strPath = strPath & strNewFile
Call FileCopy(strLocalPath, strPath)
Case "\"
' UNC path OK
Case Else
Call LogError("modUtility", "GetPicturePath", "None", _
"Drive problem: " & strPath)
End Select
GetPicturePath = True
Else
' Cancel was pressed
End If
PicExit:
Exit Function
PicError:
Call LogError("modUtility", "GetPicturePath", Err.Number, Err.Description)
Resume PicExit
End Function
This should point you in the right direction. You need to pass the Hwnd of the active form to this procedure to make sure the Common Dialog knows who its parent is, otherwise it will position itself at the top left corner of the screen.
VBSlammer