新建好目录后 使用dir 函数 确认一下有没有建好 if dir("c:\winnt")="" then msgbox "文件不存在" end if
写错了 应该是: if dir("c:\winnt",vbDirectory)="" then msgbox "文件夹不存在" end if另外 最好使用api 来移动文件 这样可靠一点 Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
if dir("c:\winnt")="" then
msgbox "文件不存在"
end if
if dir("c:\winnt",vbDirectory)="" then
msgbox "文件夹不存在"
end if另外 最好使用api 来移动文件 这样可靠一点
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
用api具体怎么实现呢??能不能给点代码???