Excel Vba©I¥soutlook±H«Hªº¤Þ¥Î°ÝÃD
- ©«¤l
- 47
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 82
- ÂI¦W
- 0
- §@·~¨t²Î
- win
- ³nÅ骩¥»
- xp
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-7-4
- ³Ì«áµn¿ý
- 2021-9-4
|
Excel Vba©I¥soutlook±H«Hªº¤Þ¥Î°ÝÃD
¤j®a¦n
·Q½Ð°Ý ¦bexcel vba¤¤©I¥soutlook±H«H®É
¥²¶·n¤â°Ê¤Þ¥Îoutlook object library
§Ú¦bA¹q¸£½s¼gexcel ¤¤ªºvba®É ¦³¤â°Ê¤Þ¥Îoutlook object library
¦ý·í§Ú§âÀÉ®×®³¨ìB¹q¸£®É ´N¥X²{¿ù»~ ¥²¶·n¦A«·s¤â°Ê¤Þ¥Îoutlook object library
¤~¥i¥H¥¿±`±H«H
·Q½Ð°Ý¦³¤°»ò¤èªk ª½±µ§â outlook object library ¥]¸Ë¦bvba¸Ì±¡H
ÁÂÁÂ |
|
|
|
|
|
|
- ©«¤l
- 47
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 82
- ÂI¦W
- 0
- §@·~¨t²Î
- win
- ³nÅ骩¥»
- xp
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-7-4
- ³Ì«áµn¿ý
- 2021-9-4
|
¥»©«³Ì«á¥Ñ ciboybj ©ó 2019-8-1 23:50 ½s¿è
¦bVBA¤¤¤]¦³«e´Á¸j©w(Early binding)¤Î«á´Á¸j©w(Late binding)ªº¤£¦P
¨âªÌªºÀu¯ÊÂI¥i¥H°Ñ¦Ò¥H¤Uºô¯¸ªº¤¶²Ð
https://wordmvp.com/FAQs/InterDev/EarlyvsLateBinding.htm
Y¬O¨Ï¥Î«á´Á¸j©w (Late Binding )«h¥i¥H¤£¥Î¤â°Ê¤Þ¥Î¬Û¹ïÀ³ªºobject library
¤]´N¬O»¡¡A¦b2010ª©Office¤¤¼g¦nªºVBAÀɮסA®³¨ì¤£¦Pªº¹q¸£¡A§Q¥Î2013ª©Office¶}±Ò®É¡AVBAµ{¦¡À³¸ÓÁÙ¬O¥i¥H¹B§@¡C
¬Û¹ïªº¡AYVBA¬O¥Î«e´Á¸j©w(Early binding) ¡A¦b¤£¦Pª©¥»OfficeªºÀô¹Ò¤U¡A«Ü¦³¥i¯à·|µLªk¥¿±`¨Ï¥Î¡A¥²¶·n¤â°Ê¤Þ¥Î¥¿½Tª©¥»ªºobject library¡C
¦ý¬O§Q¥Î«á´Á¸j©w·|¦³¤@¨Ç»yªk¬OµLªk³Q½sĶ¾¹¿ëÃÑ¡A¦]¦¹n¦Û¤v¬d¥X¹ïÀ³ªº¼Æ¦r¡C
¥H¤U¬O¤@Ó§Q¥ÎExcel ¶}±Ò¦P¸ê®Æ§¨¤¤ªº Word¡]¦¹Word¦³¤@Ó¨âÄ檺ªí®æ ¨ä¤¤¤@Äæ¼g¦³XXX¡^- Private Sub test()
- Dim path As String
- path = ThisWorkbook.path & "\test.docx"
- Dim WordApp As Object
- Set WordApp = CreateObject("Word.Application")
-
- With WordApp
- .Visible = True
- .Documents.Open path
- .Activate
- .Selection.homekey Unit:=6 'late binding ¥²¶·n¥Î¼Æ¦r6ªí¥Ü ¤£¯à¥Î wdStory
- End With
-
- WordApp.Documents.Open path
- WordApp.Visible = True 'New Apps will be hidden by default, so make visible
-
- WordApp.Selection.Find.Execute FindText:="XXX"
- WordApp.Selection.Move Unit:=12, Count:=1 'late binding ¥²¶·n¥Î¼Æ¦r12ªí¥Ü ¤£¯à¥Î wdCell
- WordApp.Selection.InsertAfter "OOO"
- WordApp.Documents.Save
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|