ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¾ß¬d¤Îµ¥«Ýzipµ{§Ç§¹¦¨

[µo°Ý] ¾ß¬d¤Îµ¥«Ýzipµ{§Ç§¹¦¨

¥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

        ÀR«ä¦Û¦b : ¦n¨Æ­n´£±o°_¡A¬O«D­n©ñ±o¤U¡A¦¨´N§O¤H§Y¬O¦¨´N¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD