Ed,
This short script between the dotted lines could be incorporated into a VBA
routine and used to send some file existing in a folder to the recycle bin.
The example simply sends a file named "pic.tif" that's located in "C:\Test"
to the recycle bin. From your VBA routine, you would establish a file name,
do a SaveAs before running the code to send to the recycle bin and then
close the open document without saving changes.
_ _ _ _ _ _ _ _ _ _ _ _
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Test")
Set objFolderItem = objFolder.ParseName("pic.tif")
objFolderItem.InvokeVerb("&Delete")
_ _ _ _ _ _ _ _ _ _ _ _
The problem is that depending on the user's version of Windows and the
settings for recycle bin, the user is likely to get a dialog requesting
confirmation that they want to send the file to the recycle bin. The script
above simply replicates what happens when you right click a file in Windows
Explorer and choose "delete" from the context menu.
I've been working on a script that would write some binary data to the
registry and toggle the setting in recycle bin on user notification off to
make it simpler to send files to the bin through code but I've not finished
yet. Moveover, I suspect it will only work on WinXP and possibly Win2k.
Steve