- ©«¤l
- 2
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 3
- ÂI¦W
- 0
- §@·~¨t²Î
- windows10
- ³nÅ骩¥»
- office2019
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2019-3-18
- ³Ì«áµn¿ý
- 2019-4-30
|
[µo°Ý] VBA¿é¥XPDF©ó¯S©w¦¸¼Æ«áµo¥Í°ÝÃD
¥»©«³Ì«á¥Ñ ntpuvnm ©ó 2019-3-19 21:41 ½s¿è
³Ìªñ¦b¶]¤½¥q¸ê®Æ²£»s¹Ïªí¿é¥X¡A¦ýµL½×¥Î¡uExportAsFixedFormat¡v©Î¡uPrintout¡vªº¤è¦¡³B²z¡A¤j¬ù165µ§¥ª¥k´N·|²§±`¡A¤U¤è¦³´ú¸Õ®Éªº¿ý¼v¬ö¿ý
1.¤£²£¥XPDF´ú¸Õ¥i¥H¶]§¹¥þ³¡¸ê®Æ
2019-03-17VBA´ú¸Õ¬ö¿ý
https://youtu.be/4NK0B0OHt9U
2.²£¥XPDF
(1)¥HExportAsFixedFormatªº¤è¦¡²£¥Xªº¸ê®Æ¸û¤p
2019-03-17VBA´ú¸Õ¬ö¿ýExportAsFixedFormat
https://youtu.be/ZtYduSyLqnQ
(2)¥Hprintout¤è¦¡²£¥Xªº¸ê®Æ¤j¬ù¬°ExportAsFixedFormat¤èªkªº2¿¤j¤p
2019-03-17VBA´ú¸Õ¬ö¿ýprint
https://youtu.be/219px5hiU2k
¨t²Î¸ê·½¤£¨¬¡AµLªk§¹¾ãÅã¥Ü¡C
¦ýµL½×¥H¦óºØ¤è¦¡¡A¤j¬ù°õ¦æ165µ§«á´N·|²§±`¡AÆ[¹îºI¹Ï«á
Ū¨ú¶q¤j¤p Printout(178,665) > ExportAsFixedFormat(151,766) > ¤£²£¥XPDF(31,057)
¼g¤J¶q¤j¤p ExportAsFixedFormat(655,688) > Printout(17,874) > ¤£²£¥XPDF(5,786)
¨ä¥LI/O¤j¤p Printout(1,190,267) > ExportAsFixedFormat(948,638) > ¤£²£¥XPDF(104,833)
°O¾ÐÅé¥Î¶q ExportAsFixedFormat(231,952K) > Printout(229,096K) > ¤£²£¥XPDF(172,692K)
²q·QÀ³¸Ó¬O°O¾ÐÅé¨Ï¥Î¶qªº°ÝÃD¡A¦ý¬O¤£²£¥XPDF¤U°õ¦æ¨ì499µ§ªº°O¾ÐÅé¶q«o¤£·|µo¥Í¡u¨t²Î¸ê·½¤£¨¬¡AµLªk§¹¾ãÅã¥Ü¡C¡vªº°ÝÃD¡A½Ð°Ý¥i¯à¬OþÓÀô¸`¥X¤F°ÝÃD©O??
¤U¤è¬°ÂàÀɮɥDn·|¥Î¨ìªºµ{¦¡½X
Sub export()
Dim FileName As String
Dim myFolder$
Dim MyFile As Object
Dim i As Integer, filemsg As Integer
myFolder = "D:\"
For i = 1 To 499
'¼È°±10¬í
If i Mod 50 = 0 Then
ThisWorkbook.save
End If
Application.StatusBar = "¥Ø«e¶i«×" & i
myfilepath = myFolder & FileName & ".pdf"
¿é¥X.ExportAsFixedFormat Type:=xlTypePDF, FileName:=myfilepath,Quality:=xlQualityStandard, IncludeDocProperties:=True,IgnorePrintAreas:=False, OpenAfterPublish:=False 'ExportAsFixedFormat¤èªk
'¿é¥X.PrintOut ActivePrinter:="Microsoft Print to PDF", Copies:=1,Collate:=True, IgnorePrintAreas:=False, PrToFilename:=myfilepath 'printout¤èªk
Application.Wait Now() + TimeValue("00:00:01")
Set MyFile = CreateObject("Scripting.FileSystemObject") 'ÀË´úÀɮפj¤p
Application.Wait Now() + TimeValue("00:00:01")
With MyFile.Getfile(myfilepath)
filemsg = Round(.Size / 1024)
'§PÂ_Àɮפj¤p
If filemsg < 50 Then
filelog = "Àɮ׿ù»~¡A±j¨î¸õ¥X°j°é"
MsgBox (filelog)
Exit For
End If
Set MyFile = Nothing
End With
Next
End Sub |
|