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

[µo°Ý] word ¥¨¶° ³Q³sÄòIJµo

[µo°Ý] word ¥¨¶° ³Q³sÄòIJµo

word ¥¨¶° ³Q³sÄòIJµo

§Ú°Ñ¦Ò·L³n  http://msdn.microsoft.com/en-us/library/office/aa211873(v=office.11).aspx

©M

http://msdn.microsoft.com/en-us/library/office/aa211915(v=office.11).aspx

https://stackoverflow.com/questions/8693798/documentbeforeclose-syntax

°µ¥X¤F word 2003 beforeprint ªº¥¨¶°

·í§Ú¦C¦L®É¡A·|¥ýIJµo³o­Ó BeforePrint ³o­Ó¥¨¶°


¥Ø«eµo¥Í¤@­Ó°ÝÃD¡A§Úµo²{·í§Ú¶}±Ò A¡BB ¨â­Ó¦PÃþ«¬doc¡A³£¦³ BeforePrint ¥¨¶°

·í§Ú¹ï A.doc°õ¦æ print ¡ABeforePrint ¥¨¶°´N·|³QIJµo 2¦¸

¦pªG§Ú¶}±Ò¤T­Ó A¡BB¡BC ¤T­Ó¡A³£¦³ BeforePrint ¥¨¶°ªº DOC

·í§Ú¹ï A.doc°õ¦æ print ¡ABeforePrint ¥¨¶°´N·|³QIJµo 3¦¸¡C

¤£³Ó©_ÂZ¡A¦³¤H¬ÝªºÀ´³o¥¨¶°¨s³º¦³¤°»ò°ÝÃD¡H

ªþ¥ó¦³»ù³æ.DOT ¡A°õ¦æ¨â¦¸´N·|·s¼W¨â­ÓDOC ¡A°õ¦æ¦C¦L´N·|µo¥Í¤W­zªº°ÝÃD

§Ú¥u·Q°w¹ï§Ú­n¦C¦LªºÀÉ®×
»ù³æ.zip (10.15 KB)
¤½¶}¸gÅç¡A³Ð³y´¼¼z¡]§Ú¤S¤£¾a³o¹L¬¡¡^

¸Ñ¡G

«Ø­Ó·sªº module

±N
Dim X As New EventClassModule
Sub Register_Event_Handler()
Set X.appWord = Word.Application
End Sub

²¾¹L¥h¡A¤£­n©ñ¦b ThisDocument
¤½¶}¸gÅç¡A³Ð³y´¼¼z¡]§Ú¤S¤£¾a³o¹L¬¡¡^

TOP

¥»©«³Ì«á¥Ñ linyancheng ©ó 2018-6-9 23:06 ½s¿è

¦^´_ 2# eigen


Document_Open¦bdotÀɨS¦³§@¥Î¡A«O¯dDocument_New§Y¥i¡C

¦bThisDocument¼Ò²Õ¬°Private Sub¼Ò²Õ¡A
¨â­ÓÀɮפU¡ADim X¦U¦Û¦s¦b¡A
¬G·|²£¥Í¨â­Óª«¥óÃþ§O¼Ò²Õªºª«¥ó¡u¼v¤l¡v¡A
¤T­ÓÀÉ®×´N·|²£¥Í¤T­Ó¡A
¤]´N¦P®É¤Þ°_´X­ÓIJµo¨Æ¥ó¡C

¤@¯ë¼Ò²Õ¤U¬°Public Sub¼Ò²Õ¡A
¤£ºÞ¶}´X­ÓÀɮסADim X¥u¦³¤@­Ó¡A
¥uSet¤@¦¸¡A
¤]¥u²£¥Í¤@­Óª«¥ó¡u¼v¤l¡v¡A
IJµo¨Æ¥ó¤]¥u¦³¤@¦¸¡C

¡u¼v¤l¡vªº¡u¹êÅé¡v¬OWord.Application¡A
¥ô¦ó·s¶}ªºÀɮ׳£·|¨ü¼vÅT¡A¤£¥u¥H¥¦¬°½d¥»ªºÀɮסC

TOP

        ÀR«ä¦Û¦b : ¬°¤H³B¥@­n¤p¤ß²Ó¤ß¡A¦ý¤£­n¡u¤p¤ß²´¡v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD