'No Módulo 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 FO_DELETE = &H3 Public Const FOF_ALLOWUNDO = &H40
Public Sub Recycle(ByVal FileName As String) Dim SHFileOp As SHFILEOPSTRUCT Dim RetVal As Long
With SHFileOp .wFunc = FO_DELETE .pFrom = FileName .fFlags = FOF_ALLOWUNDO End With
'deletando o arquivo RetVal = SHFileOperation(SHFileOp) End Sub
'Para Chamar a Rotina Recycle "C:\Windows\Notepad.exe"