ªð¦^¦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 : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD