{"id":1010,"date":"2022-09-17T08:40:21","date_gmt":"2022-09-16T23:40:21","guid":{"rendered":"https:\/\/beiyan-tool.info\/?p=1010"},"modified":"2022-09-17T08:40:21","modified_gmt":"2022-09-16T23:40:21","slug":"excel-vba%e3%81%a7%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ab%e7%94%bb%e5%83%8f%e3%82%92%e6%8c%bf%e5%85%a5%e3%81%97%e3%81%a6outlook%e3%81%a7%e9%80%81%e4%bf%a1%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/beiyan-tool.info\/?p=1010","title":{"rendered":"Excel VBA\u3067\u30e1\u30fc\u30eb\u306b\u753b\u50cf\u3092\u633f\u5165\u3057\u3066OutLook\u3067\u9001\u4fe1\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>Excel VBA\u3067\u30e1\u30fc\u30eb\u306b\u753b\u50cf\u3092\u633f\u5165\u3057\u3066OutLook\u3067\u9001\u4fe1\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<br \/>\nHTML\u30e1\u30fc\u30eb\u306e\u672c\u6587\u306bQR\u30b3\u30fc\u30c9\u306a\u3069\u3092\u633f\u5165\u3057\u305f\u3044\u3068\u304d\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<br \/>\n\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092Base64\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066\u3001HTML\u306b\u57cb\u3081\u8fbc\u3080\u3053\u3068\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3066\u8aad\u307f\u8fbc\u3093\u3067\u30e1\u30fc\u30eb\u306e\u672c\u6587\u306bHTML\u30bf\u30b0\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3001\u4e0b\u66f8\u304d\u306b\u4fdd\u5b58\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre class=\"lang:vb decode:true \" title=\"Excel VBA\u3067\u30e1\u30fc\u30eb\u306b\u753b\u50cf\u3092\u633f\u5165\u3057\u3066OutLook\u3067\u9001\u4fe1\u3059\u308b\u30b3\u30fc\u30c9\" >    Dim objOutlook As Object\r\n    Set objOutlook = CreateObject(\"Outlook.Application\")\r\n    Set objMail = objOutlook.CreateItem(0)\r\n    \r\n \r\n    With objMail\r\n    \r\n    \r\n    \r\n        Set .SendUsingAccount = objOutlook.Session.Accounts.Item(\"[\u9001\u4fe1\u5143\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9]\")\r\n    \r\n        .Subject = \"[\u30e1\u30fc\u30eb\u306e\u4ef6\u540d]\"\r\n    \r\n       \r\n       '\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092Base64\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\r\n        Dim objBase64 As Object\r\n        Dim strBase64 As String\r\n        Dim sImageFilePath As String\r\n        sImageFilePath = \"[\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9]\"\r\n        \r\n        Dim sImageTag As String\r\n        \r\n        Set objBase64 = CreateObject(\"MSXML2.DOMDocument\").createElement(\"base64\")\r\n        With CreateObject(\"ADODB.Stream\")\r\n        \r\n            .Type = 1\r\n            \r\n            .Open\r\n            \r\n            .LoadFromFile sImageFilePath\r\n            \r\n            objBase64.DataType = \"bin.base64\"\r\n            \r\n            objBase64.nodeTypedValue = .Read(-1)\r\n            \r\n            strBase64 = objBase64.Text\r\n            \r\n            .Close\r\n        \r\n        End With\r\n        \r\n        '\u3053\u308c\u304c\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306eHTML\u30bf\u30b0\u306b\u306a\u308a\u307e\u3059\r\n        sImageTag = \"&lt;img src=\"\"data:image\/jpeg;base64,\" &amp; strBase64 &amp; \"\"\" \/&gt;\"\"\"\r\n        \r\n        '\u4eca\u56de\u306f\u753b\u50cf\u3060\u3051\u3092\u30e1\u30fc\u30eb\u306e\u672c\u6587\u3068\u3057\u307e\u3057\u305f\r\n        .HTMLBody = sImageTag\r\n    \r\n        .To = \"[\u9001\u4fe1\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9]\"\r\n        \r\n        .Close (0) '\u4e0b\u66f8\u304d\u306b\u4fdd\u5b58\u3059\u308b\u3000\u9001\u4fe1\u3059\u308b\u5834\u5408\u306f\u3001.Send\r\n        \r\n    \r\n    End With<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Excel VBA\u3067\u30e1\u30fc\u30eb\u306b\u753b\u50cf\u3092\u633f\u5165\u3057\u3066OutLook\u3067\u9001\u4fe1\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3057\u305f\u3002 HTML\u30e1\u30fc\u30eb\u306e\u672c\u6587\u306bQR\u30b3\u30fc\u30c9\u306a\u3069\u3092\u633f\u5165\u3057\u305f\u3044\u3068\u304d\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002 \u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092Base64\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1010","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/1010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1010"}],"version-history":[{"count":1,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/1010\/revisions"}],"predecessor-version":[{"id":1011,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/1010\/revisions\/1011"}],"wp:attachment":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}