ChDir 语句
修改当前目录或驱动器。
This statement currently does not work as documented. See this issue for more information.
语法:
ChDir Text As String
参数:
Text: 用于指定目录路径或驱动器的任意字符串表达式。
如果只需要修改当前驱动器,请输入驱动器号,并在后面加上冒号。
示例:
Sub ExampleChDir
Dim sDir1 As String , sDir2 As String
sDir1 = "c:\Test"
sDir2 = "d:\Private"
ChDir( sDir1 )
MsgBox CurDir
ChDir( sDir2 )
MsgBox CurDir
End Sub