展开全部
Option Explicit
Dim mystr As String
Dim Source As String ' 源文件
Dim Target As String ' 目标文件
Dim retval
Private Sub Command1_Click() ,=========压缩文件
mystr = "C:\Program Files\WinRAR\winrar.exe" 'winrar.exe文件路径
Source = App.Path & "\111.jpg"
Target = App.Path & "\111.rar" '压缩格式可以是rar,也可以是cab....
mystr = mystr & " a " & Target & " " & Source '命令字符串
retval = Shell(mystr, vbHide)
End Sub
Private Sub Command2_Click() ‘===========解压文件
mystr = "C:\Program Files\WinRAR\winrar.exe"
Source = App.Path & "\111.rar"
Target = App.Path & "\new" '存放压缩文件的位置
mystr = mystr & "X" & Source & " " & Target
Text1.Text = mystr
retval = Shell(mystr, vbHide)
End Sub
Private Sub Command3_Click()
End
End Sub
Dim mystr As String
Dim Source As String ' 源文件
Dim Target As String ' 目标文件
Dim retval
Private Sub Command1_Click() ,=========压缩文件
mystr = "C:\Program Files\WinRAR\winrar.exe" 'winrar.exe文件路径
Source = App.Path & "\111.jpg"
Target = App.Path & "\111.rar" '压缩格式可以是rar,也可以是cab....
mystr = mystr & " a " & Target & " " & Source '命令字符串
retval = Shell(mystr, vbHide)
End Sub
Private Sub Command2_Click() ‘===========解压文件
mystr = "C:\Program Files\WinRAR\winrar.exe"
Source = App.Path & "\111.rar"
Target = App.Path & "\new" '存放压缩文件的位置
mystr = mystr & "X" & Source & " " & Target
Text1.Text = mystr
retval = Shell(mystr, vbHide)
End Sub
Private Sub Command3_Click()
End
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询