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

EXCEL VBA¥N¤JWORDÀɸ̭±

EXCEL VBA¥N¤JWORDÀɸ̭±

¦U¦ì«e½ú±z¦n¡G

¤p§Ì³Ìªñ¦b´ú¸ÕEXCEL VBA·s¼W¤@­ÓWORD¤§«á¡]¬O¥Î¦Û­qªí³æ¦A¼W¥[BUTTONªº¤è¦¡¡^¡A
­n§âEXCELªº¤å¦r¥N¤J·s¼WªºWORDÀɸ̡A
§Æ±æ·s¼WWORDªºVBA©M¥N¤Jªº¤å¦rªºVBA¬O¤À¶}¨ÓªºBUTTON¡A©Ò¥H²©öªº´ú¸Õ¦p¤U¡G
«öButton1ªº®É­Ô¨S°ÝÃD¡C
¦ý¬O­è¶}©l«öButton2ªº®É­Ô¡A¦pªG¨S¦³¥´«e­±ªºDIM¨º¨â¦æ¡A´N·|¥X²{¦¹³B»Ý­nª«¥ó¡C
¦ý¬O¥[¤F«e­±2¦æ¡A²Ä3¦æ·|¥X²{¡G
¡u¨S¦³³]©wª«¥óÅܼƩΠwith °Ï¶ôÅܼơv
¥i¥H½Ð«e½ú«ü¾É¤@¤U¶Ü¡H

¦pªG¬O§â¤å¦rª½±µ¥´¦bCreateWDªºSUB¸Ì­±¡A°ò¥»¤W¨S¤°»ò°ÝÃD¡C
¤£¹L¦]¬°¿é¤Jªº¤å¦r¤£©w¡]¦³¥i¯à¬OSheet1¡A¦³¥i¯à¬OSheet2¸Ì­±ªº¤å¦r¡^
¡A©Ò¥H¤~§Æ±æ¥Î¥N¤Jªº¤è¦¡¥t¥~¦A°µ¤@­ÓButton¡C

ÁÙ±æ«e½ú¦³ªÅ®É¯à«üÂI¤p§Ì¤@µf¡AÁÂÁ¦U¦ì«e½ú¡I
  1. Private Sub CommandButton1_Click()
  2. Call CreateWD
  3. End Sub
½Æ»s¥N½X
  1. Private Sub CommandButton2_Click()
  2. Dim wordapp As Word.Application
  3. Set wordapp = CreateObject("word.application")
  4. wordapp.Selection.TypeText "test"
  5. End Sub
½Æ»s¥N½X
  1. Private Sub CreateWD()
  2. Dim wordapp As Word.Application
  3. Set wordapp = CreateObject("word.application")
  4. wordapp.Visible = True
  5. wordapp.Documents.Add
  6. End Sub
½Æ»s¥N½X

¦^´_ 1# LITTLEFAT7048


    ª©¤j¦n¡A
    ¥i¥Hªþ¹Ï¨ÃÁ|¨Ò»¡©ú¤@¤U¶Ü?
    ³o¼Ë§ó¨ãÅé²M·¡¤§¥~¡A
    ¤]¤ñ¸û¤è«K¯¸¤W¤j¯«À°§A§Ö³t¸Ñµª³á^^

TOP

¥»©«³Ì«á¥Ñ LITTLEFAT7048 ©ó 2018-5-22 15:57 ½s¿è

¦^´_ 2# nolookyou



·s¼WWORDªºBUTTONÂI¤U¥h¤§«á·|¦h¤@­ÓWORD·sÀÉ¡A
¦]¬°·s¼WªºWORDÀɭ쥻·|¦³ªí®æ¡]²{¦bºI¹Ï¨S¦³¡A¦]¬°´ú¸Õ¥Î¡^¡A
¤p§Ì§Æ±æÂI¤U­±ªº¥N¤J¸ê®Æ¡A
·|±N¤u§@ªí1ªºA1~A4Äæ¥N¤J¶i¥h¡A
¤£¹L¥¼¨Óªº·Qªk¬O¥i¯à·|¤@ª½¼W¥[¡A
©Ò¥H¨ì®É«á¥N¤J¸ê®Æ·|Åܦ¨¥i¥H¥Î¿ïªº¡]¥Ø«eªº·Qªk¬O­n¥ÎINPUTBOX¡^¥h¿é¤J·Q­nªº¸ê®Æ¡A
¨Ò¦p¡GAÄæ´N¿é¤J1¡ABÄæ´N¿é¤J2¡K¥H¦¹Ãþ±À¡C
©Ò¥H¤~·|§Æ±æ¤@­ÓBUTTON¬O·s¼WWORDÀɪºªí®æ¡A
¥t¥~¤@­ÓBUTTON´N¬O±NEXCEL ªº¤å¦r¸ê®Æ¥N¤J·s¼Wªº¨º­ÓWORDÀɸ̡A
½Ð°Ý³o¼Ë«e½ú¬Ý±oÀ´¶Ü¡HQQ

TOP

¦^´_ 3# LITTLEFAT7048


    °²¦p§ï¦¨¡G¤@­Ó«ö¶s«ö¤U¥h
   §¹¦¨¡G
   1.¶}·sªºWORDÀÉ
   2.±N«ü©wªºEXCELÄæ¦ì¸ê®Æ¡A¼g¨ìWORD¸Ì­±

    ³o¼Ë¤ñ¸û¤è«K¡Aª©¤j³o¼ËOK¶Ü?

TOP

¦^´_  LITTLEFAT7048


    °²¦p§ï¦¨¡G¤@­Ó«ö¶s«ö¤U¥h
   §¹¦¨¡G
   1.¶}·sªºWORDÀÉ
   2.±N«ü©wªºE ...
nolookyou µoªí©ó 2018-5-22 17:18

«e½ú±z«Øijªº¤p§Ì¦³¸Õ¹L²³æªº¡A°ò¥»¤W¨S¦³°ÝÃD¡C
¤£¹L·íªì¦]¬°µeªí®æªºµ{¦¡½X¤Ó¹L¤¾ªø¡A©Ò¥H¤~·|·Q»¡¿W¥ß¥X¨Ó¤@­ÓSUB¡A
¦ý¬O¿W¥ß¥X¨Ó¤§«á¤~µo²{¦³³oºØ°ÝÃD¦]¦Ó¤Wºô´M¨D¦³¸gÅ窺«e½ú«ü¾É¡A
¤p§Ìµo²{¦n¹³¬O¦]¬°¦pªG´«­ÓSUB¡A
¨º­ì¥»¨Ï¥Î¤¤ªºWORD´N¤£»{ÃѤFXD...
¥i¯àSUB¥u»{ÃÑ¥L¦Û¤v·s¼WªºWORD...

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD