剪切的代码怎么写
剪切代码怎么写 望指教
Private Sub Command1_Click() FileCopy "C:\abc", "D:\abc" '文件"C:\abc"复制到"D:\abc" Kill "C:\abc" '删除源文件 End Sub2、使用API函数:
'先在(声明)部分声明API函数: Private Declare Function MoveFileEx& Lib "kernel32" Alias "MoveFileExA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal dwFlags As Long) Private Const MOVEFILE_COPY_ALLOWED = &H2 '然后是移动文件的代码: Private Sub Command1_Click() MoveFileEx& "C:\abc", "D:\abc", MOVEFILE_COPY_ALLOWED '移动文件C:\abc至D:\abc End Sub