Table of contents
Collapse the table of content
Expand the table of content

Delete Method (Visual Basic for Applications)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Description Deletes a specified file or folder. Syntaxobject. Deleteforce The Delete method syntax has these parts:

objectRequired. Always the name of a File or Folder object.
forceOptional. Boolean value that is True if files or folders with the read-only attribute set are to be deleted; False (default) if they are not.

Remarks An error occurs if the specified file or folder does not exist. The results of the Delete method on a File or Folder are identical to operations performed using FileSystemObject.DeleteFile or FileSystemObject.DeleteFolder. The Delete method does not distinguish between folders that have contents and those that do not. The specified folder is deleted regardless of whether or not it has contents.

© 2018 Microsoft