トップページ(目次)

041.ファイルをごみ箱へ削除

<実行前後>
 → 
Sub ファイルをごみ箱へ削除()
    
    '削除したいファイルをフルパスで指定する、ワイルドカード(例:"C:\test\*.txt")も使用可
    削除したいファイル = Dir("C:\test\test1.txt")
    
    'ごみ箱へ移動する
    CreateObject("Shell.Application").Namespace(10).MoveHere "C:\test\" & 削除したいファイル
    
End Sub

Copyright © 2021 https://excel3000.web.fc2.com/ All Rights Reserved.
    inserted by FC2 system