Sergey,
Your example works nicely. Now do you know if and how I can set the flags to have the user select a folder/directory rather than a file(s)?
Thans again for all your help.
Mike.
>Try
oDlg = Createobject("GetFileEx")
>? oDlg.GetFile()
>
>DEFINE CLASS GetFileEx AS form
> Left = 100
> Top = 100
> Name = "GetFIleEx"
> DoCreate = .T.
> Visible = .F.
> ADD OBJECT oCDC AS OleControl WITH ;
> OleClass = "MsComDlg.CommonDialog"
>
> PROCEDURE GetFile(tnInitColor)
> LOCAL lnColor
> Thisform.oCDC.ShowOpen()
> ENDPROC
>ENDDEFINE
>
>>Thanks for the lead Sergey. I haven't tried it yet but I did try the following:
>>
>>oDialog = CREATEOBJECT("MsComDlg.CommonDialog")
>>oDialog.flags = "&H80806"
>>oDialog.dialogtitle = "This is a test"
>>oDialog.showsave
>>
>>The last line produced an error as follows:
>>
>>"Error: 1429 OLE IDispatch exception code 0 from CommonDialog. The common dialog function failed during initialization. This error often occurs when insufficient memory is available...in line 0".
>>
>>Do you have any idea what I did wrong?