哦 忘了附上 我函数的定义了
Option Explicit
Const FO_MOVE = &H1
Const FO_COPY = &H2
Const FO_DELETE = &H3
Const FO_RENAME = &H4Const FOF_NOCONFIRMATION = &H10
Const FOF_NOCONFIRMMKDIR = &H200
Const FOF_ALLOWUNDO = &H40Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End TypePrivate Declare Function SHFileOperation Lib "shell32.dll" Alias " SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Dim SHFileOp As SHFILEOPSTRUCTPrivate Sub Command3_Click() '复制文件
Dim fdir As String
fdir = App.Path
SHFileOp.wFunc = FO_COPY
SHFileOp.pFrom = sFile + Chr(0)
SHFileOp.pTo = fdir
SHFileOp.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION
SHFileOperation SHFileOp
End Sub
Option Explicit
Const FO_MOVE = &H1
Const FO_COPY = &H2
Const FO_DELETE = &H3
Const FO_RENAME = &H4Const FOF_NOCONFIRMATION = &H10
Const FOF_NOCONFIRMMKDIR = &H200
Const FOF_ALLOWUNDO = &H40Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End TypePrivate Declare Function SHFileOperation Lib "shell32.dll" Alias " SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Dim SHFileOp As SHFILEOPSTRUCTPrivate Sub Command3_Click() '复制文件
Dim fdir As String
fdir = App.Path
SHFileOp.wFunc = FO_COPY
SHFileOp.pFrom = sFile + Chr(0)
SHFileOp.pTo = fdir
SHFileOp.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION
SHFileOperation SHFileOp
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货