Send a file to the Recycle Bin of Windows 95: In the General Declarations area of a basic module place: Public Type SHFILEOPSTRUCT hwnd As Long wFunc As Long pFrom As String pTo As String fFlags As Integer fAnyOperationsAborted As Boolean hNameMappings As Long lpszProgressTitle As String End Type Public Declare Function SHFileOperation Lib "shell32.dll" Alias _ "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long Public Const F0_DELETE = &H3 Public Const F0F_ALLOWUNDO = &H40 ' Explorer type dialog Public Const FOF_CREATEPROGRESSDLG As Long = &H0 In a new function procedure of the above module place: Public Function DelToRecycleBin(FileName As String) As Boolean Dim FileOperation As SHFILEOPSTRUCT Dim lReturn As Long On Error GoTo DelToRecycleBin_Err With FileOperation .wFunc = F0_DELETE .pFrom = FileName .fFlags = F0F_ALLOWUNDO + F0F_CREATEPROGRESSDLG End With lReturn = SHFileOperation(FileOperation) If lReturn <> 0 Then DelToRecycleBin = False Else DelToRecycleBin = True End If Exit Function DelToRecycleBin_Err: DelToRecycleBin = False MsgBox Err.Description End Function In the click event of a commandbutton or any event you want place: DelToRecycleBin ("c:\test.txt") (this assumes there is a file named test.txt in the c-root drive) For More Information Contact: Computer Consulting CompanyAddress Tel: CompanyPhone FAX: CompanyFAX Internet: CompanyEmail Email Us Send mail to CompanyWebmaster with questions or comments about this web site. Copyright © 1996 Computer Consulting Last modified: September 03, 2001José Luis.
Quidquid latine dictum sit, altum sonatur