- ©«¤l
- 34
- ¥DÃD
- 14
- ºëµØ
- 0
- ¿n¤À
- 61
- ÂI¦W
- 0
- §@·~¨t²Î
- Winxp
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-1-25
- ³Ì«áµn¿ý
- 2019-3-4
|
¥H¤Uµ{¦¡½X¬O±Nexcel file zip°_¨Ó¡A§Ú»Ýn¾ß¬d¤Îµ¥«Ýzipµ{§Ç§¹¦¨¡A½Ð°Ýn«ç¼Ë¼g¡H
¸Õ¹L¥ÎDir(FileNameZip)¦ýNewZip Sub¤w¸g«Ø¥ß¤F¤@ӪŪºFileNameZip¡A©Ò¥H¤£¯à¥Î³oÓ:'(
¦h½Ð¤j¤j«ü±Ð:)
Sub Main()
Dim FileNameZip, FileNameXls
FileNameXls = "C:\Book1.xlsx"
FileNameZip = "C:\Book1.zip"
Call NewZip(FileNameZip)
Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameZip).CopyHere FileNameXls
'¦]¬°FileNameXls¤ñ¸û¤j¡A¦Ó¤§«á§Ú»Ýn±NFileNameZip´¡¤Jemail¬°ªþ¥ó¡A©Ò¥H§Ú»Ýn¦³³o¸Ì¾ß¬d¤Îµ¥«ÝZip file §¹¦¨¤~Ä~Äò¤U¥h¡CÀ³¸Ó«ç¼g¡H
End Sub
'-------------------------------------------------------------
Sub NewZip(sPath)
'Create empty Zip File
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 |
|