USER = &amp;H400&amp;

Private Const CDM_FIRST = (WM_USER + 100)
Private Const CDM_GETFILEPATH = (CDM_FIRST + &amp;H1)
Private Const MAX_PATH = 260

Public Property Get GetCDlgFileName(ByVal hDlg As Long) As String
Dim sBuf As String
Dim iPos As Long
Dim hwnd As Long
   hwnd = GetParent(hDlg)
   sBuf = String$(MAX_PATH, 0)
   SendMessageString hwnd, CDM_GETFILEPATH, 260, sBuf
   iPos = InStr(sBuf, vbNullChar)
   If iPos &gt; 0 Then
      GetCDlgFileName = left$(sBuf, iPos - 1)
   End If
End Property
</pre><