'move a file to the recycle bin Private Type SHFILEOPSTRUCThwnd As LongwFunc As LongpFrom As StringpTo As StringfFlags As IntegerfAnyOperationsAborted As LonghNameMappings As LonglpszProgressTitle As LongEnd TypePrivate Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As LongPrivate Const FO_DELETE = &H3Private Const FOF_ALLOWUNDO = &H40Dim typOperation As SHFILEOPSTRUCTWith typOperation.wFunc = FO_DELETE.pFrom = "filename.txt" 'File to move to bin.fFlags = FOF_ALLOWUNDOEnd WithSHFileOperation typOperation