WordBasic Kill Statement Defined

ID: Q50801


The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c


SUMMARY

The WordBasic Kill statement deletes a file from disk.

Syntax


Kill "Name$"      Name$ is the name of the file to be deleted. 
The name can include a path specification and must be enclosed in double quotation marks.

Example


Sub MAIN
Kill "C:\WINWORD\DOCUMENT.DOC"
End Sub 


MORE INFORMATION

The Name$ argument can contain question marks (?) or asterisks (*) used as wildcards. A question mark matches any single character in the filename or extension. An asterisk matches one or more characters starting at its position in the string. Use caution when using wildcards with Kill. You can delete many files unintentionally with the wildcard characters.

Kill is used for all types of disk files: program files, random data files, and sequential data files.

Kill deletes only files, however. Kill does not delete directories. To delete directories, use the RmDir command.

For more information on WordBasic functions and statements, please refer to the "Microsoft Word for Windows Technical Reference."

Additional query words: 1.x 2.0 winword2 word6 6.0 winword

Keywords :
Version : WINDOWS:1.0,1.1,1.1a,2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c
Platform : WINDOWS
Issue type :


Last Reviewed: December 22, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.