{"id":35429,"date":"2020-02-22T21:11:26","date_gmt":"2020-02-22T13:11:26","guid":{"rendered":"http:\/\/4563.org\/?p=35429"},"modified":"2020-02-22T21:11:26","modified_gmt":"2020-02-22T13:11:26","slug":"e5%e7%bb%ad%e8%ae%a2%e4%b9%8bvba%e8%b0%83%e7%94%a8outlook-api","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=35429","title":{"rendered":"E5\u7eed\u8ba2\u4e4bVBA\u8c03\u7528Outlook API"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>xiaoque<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>E5\u7eed\u8ba2\u4e4bVBA\u8c03\u7528Outlook API<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 xiaoque \u4e8e 2020-2-22 20:23 \u7f16\u8f91 <\/p>\n<p> \u4e0d\u77e5\u9053\u7528Excel VBA\u8c03\u7528Outlook\u5ba2\u6237\u7aef\u53d1\u90ae\u4ef6\uff0c\u7b97\u4e0d\u7b97\u8c03\u7528\u4e86Outlook API\uff0c\u53d1\u6bb5\u4ee3\u7801\u7ed9\u5404\u4f4d\u8bd5\u8bd5<\/p>\n<p>  Sub SentEmail()<br \/>  &nbsp; &nbsp; Dim OLApp As Outlook.Application<br \/>  &nbsp; &nbsp; Dim OLMail As Object<br \/>  &nbsp; &nbsp; Dim MyCell As Range<br \/>  &nbsp; &nbsp; Dim MyContacts As Range<br \/>  &nbsp; &nbsp; Set MyContacts = Sheets(&quot;Email&quot;).Range(&quot;A1:A5&quot;)<br \/>  &nbsp; &nbsp; Set OLApp = New Outlook.Application<br \/>  &nbsp; &nbsp; Set OLMail = OLApp.CreateItem(0)<br \/>  &nbsp; &nbsp; OLApp.Session.Logon<br \/>  &nbsp; &nbsp; With OLMail<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;.BCC = &quot;&quot;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;For Each MyCell In MyContacts<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;.BCC = .BCC &amp; MyCell.Value &amp; &quot;;&quot;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;Next MyCell<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;.Subject = &quot;\u90ae\u4ef6\u4e3b\u9898&quot;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;.Body = &quot;\u90ae\u4ef6\u5185\u5bb9&quot;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;.Display<br \/>  &nbsp; &nbsp; End With<br \/>  &nbsp; &nbsp; Set OLMail = Nothing<br \/>  &nbsp; &nbsp; Set OLApp = Nothing&nbsp; &nbsp; <br \/>  End Sub<\/p>\n<p>  VBA\u91cc\u9009\u62e9Microsoft Excel \u5bf9\u8c61\uff0c\u7136\u540e\u6dfb\u52a0\u6a21\u5757\uff0c\u7136\u540e\u5728\u6a21\u5757\u91cc\u6dfb\u52a0\u4e0a\u9762\u4ee3\u7801\uff0c\u6dfb\u52a0\u5b8c\u4ee3\u7801\u540e\uff0c\u5728VBA\u83dc\u5355\u680f\u9009\u62e9\uff1a\u5de5\u5177-\u5f15\u7528\uff0c\u7136\u540e\u9009\u62e9Microsoft Outlook 16.0 Object Library\uff0c\u786e\u5b9a<\/p>\n<p>  https:\/\/tu.my\/2020\/02\/22\/537289422eeca.png<\/p>\n<p>  \u7136\u540e\u547d\u540d\u5de5\u4f5c\u8868\u540d\u4e3a\uff1aEmail\uff0c\u5728\u8868A1\u81f3A5\u5217\u6dfb\u52a0\u90ae\u7bb1\u5730\u5740<\/p>\n<p>  https:\/\/tu.my\/2020\/02\/22\/12baccb5eadb2.png<\/p>\n<p>  \u5728\u5de5\u4f5c\u8868\u4e2d\u6dfb\u52a0\u63a7\u4ef6\uff0c\u9009\u62e9SentEmail\u8fc7\u7a0b<\/p>\n<p>  \u70b9\u51fb\u63a7\u4ef6\u6309\u94ae\uff0c\u8c03\u7528Outlook\u5ba2\u6237\u7aef\u53d1\u90ae\u4ef6<\/p>\n<p>  https:\/\/tu.my\/2020\/02\/22\/ccf27682333f4.png<\/p>\n<p>  \u6700\u540e\u628a\u4e0a\u9762\u8bbe\u7f6e\u597d\u7684EXCEL\u6587\u4ef6\u53e6\u5b58\u4e3a\uff1a.xlsm\u683c\u5f0f\u7684\u201c\u542f\u7528\u5b8f\u7684\u5de5\u4f5c\u8584\u6587\u4ef6\u201d\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4e00\u4f4d\u4e0d\u77e5\u540d\u7f51\u53cb<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6211\u770b\u4e0d\u61c2\u554a\uff0c\u697c\u4e0b\u6765\u89e3\u91ca\u4e0b\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>xiaoque<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u8fd8\u8981\u4e0a\u56fe\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>xiaoque<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u56fe\u4e0a\u5b8c\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>hotsky<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\toffice365\u600e\u4e48\u627e\u4e0d\u5230VBA\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>xiaoque<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\thotsky \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-22 19:07<br \/>  office365\u600e\u4e48\u627e\u4e0d\u5230VBA<\/p>\n<p> Alt+F11\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>hotsky<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\txiaoque \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-22 19:08<br \/>  Alt+F11<\/p>\n<p> \u6309\u4e86, \u5c31\u662f\u6ca1\u53cd\u5e94, \u8bd5\u4e86\u51e0\u4e2a\u65b9\u6cd5\u4e86, \u6211\u5728\u6000\u7591\u662f\u4e0d\u662foffice365\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd\u554a\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>cherbim<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 cherbim \u4e8e 2020-2-22 19:14 \u7f16\u8f91 <\/p>\n<p> \u611f\u89c9\u4e0d\u7b97\uff0c\u5b83\u53ea\u662f\u5524\u9192outlook\u90ae\u7bb1\uff0c\u5177\u4f53\u64cd\u4f5c\u8fd8\u662foutlook\u90ae\u7bb1\u5e72\u7684\u6d3b<br \/>  \u4e0d\u8fc7\u5fae\u8f6f\u8bf4\u7684\u662f90\u5929\u5185\u9700\u8981\u8bc1\u660e\u662f\u5f00\u53d1\u8005\u624d\u80fd\u81ea\u52a8\u7eed\u8ba2\uff0c\u6240\u4ee5\u600e\u4e48\u7b97\u662f\u5f00\u53d1\u8005\uff0c\u5fae\u8f6f\u662f\u548b\u5224\u5b9a\u7684\uff1f\u600e\u4e48\u4fdd\u6301\u7528\u6237\u6d3b\u8dc3\u5ea6\uff1f\u4e5f\u6ca1\u4e2a\u51c6\u786e\u4fe1\u606f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>xiaoque<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 xiaoque \u4e8e 2020-2-22 19:55 \u7f16\u8f91 <\/p>\n<p> hotsky \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-22 19:11<br \/>  \u6309\u4e86, \u5c31\u662f\u6ca1\u53cd\u5e94, \u8bd5\u4e86\u51e0\u4e2a\u65b9\u6cd5\u4e86, \u6211\u5728\u6000\u7591\u662f\u4e0d\u662foffice365\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd\u554a &#8230;<\/p>\n<p>  \u6709\u7684\uff0c\u6211\u5c31\u662f\u7528Office 365\u6765\u64cd\u4f5c\u7684\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>xiaoque<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tcherbim \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-22 19:11<br \/>  \u611f\u89c9\u4e0d\u7b97\uff0c\u5b83\u53ea\u662f\u5524\u9192outlook\u90ae\u7bb1\uff0c\u5177\u4f53\u64cd\u4f5c\u8fd8\u662foutlook\u90ae\u7bb1\u5e72\u7684\u6d3b<br \/>  \u4e0d\u8fc7\u5fae\u8f6f\u8bf4\u7684\u662f90\u5929\u5185\u9700\u8981\u8bc1\u660e\u662f\u5f00\u53d1\u8005 &#8230;<\/p>\n<p> \u4e0d\u6e05\u695a\u4e86\uff0c\u53ef\u4ee5\u914d\u5408oneindex\u4f7f\u7528\u8bd5\u8bd5\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>xiaoque \u5927\u4f6c\u6709\u8bdd\u8bf4 : E&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/35429"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=35429"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/35429\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=35429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=35429"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=35429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}