Reset 语句
关闭使用 Open 语句打开的所有磁盘文件。
语法
Reset
备注
Reset 语句关闭通过 Open 语句打开的所有活动文件,并将所有文件缓存的内容写入磁盘。
示例
此示例使用 Reset 语句关闭所有打开的文件,并将所有文件缓存的内容写入磁盘。 请注意, Variant 变量可同时用作字符串和数字。
Dim FileNumber
For FileNumber = 1 To 5 ' Loop 5 times.
' Open file for output. FileNumber is concatenated into the string
' TEST for the file name, but is a number following a #.
Open "TEST" & FileNumber For Output As #FileNumber
Write #FileNumber, "Hello World" ' Write data to file.
Next FileNumber
Reset ' Close files and write contents
' to disk.
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈