Professional Documents
Culture Documents
Caminho = str
Ponto = InStrRev(Caminho, ".")
Extensao = Mid(Caminho, Ponto + 1, Len(Caminho) -
Ponto)
Caminho_Zip = Left(Caminho, Ponto - 1) & ".zip"
Nome_Arquivo = Mid(Caminho, InStrRev(Caminho, "\")
+ 1, Len(Caminho))
Pasta_Arquivo = Replace(Caminho, "\" &
Nome_Arquivo, "")
Nome_Arquivo_1 = Mid(Caminho, InStrRev(Caminho,
"\") + 1, Ponto - InStrRev(Caminho, "\") - 1)
Call Limpa_Pasta
Fname = Caminho_Zip
DefPath = Pasta_Arquivo
If Right(DefPath, 1) "\" Then
DefPath = DefPath & "\"
End If
MkDir FileNameFolder
oApp.Namespace(FileNameFolder).CopyHere
oApp.Namespace(Fname).items
On Error Resume Next
Set FSO =
CreateObject("scripting.filesystemobject")
FSO.deletefolder Environ("Temp") & "\Temporary
Directory*", True
Close #1
Open FileNameFolder & "xl\worksheets\" &
Arquivos For Input As #1
strFinal = Empty
Texto_Final = Empty
While EOF(1) = False
Arquivos = Dir()
Wend
DefPath = Pasta_Arquivo
If Right(DefPath, 1) "\" Then
DefPath = DefPath & "\"
End If
NewZip (FileNameZip)
oApp1.Namespace(FileNameZip).CopyHere
oApp1.Namespace(FolderName).items
Sub NewZip(sPath)
If Len(Dir(sPath)) > 0 Then Kill sPath
Open sPath For Output As #1
Print #1, Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) &
String(18, 0)
Close #1
End Sub
Sub Limpa_Pasta()
On Error Resume Next
Set FSO = CreateObject("scripting.filesystemobject")