{"id":8550,"date":"2017-06-12T15:00:16","date_gmt":"2017-06-12T06:00:16","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=8550"},"modified":"2017-06-12T15:50:49","modified_gmt":"2017-06-12T06:50:49","slug":"outlook%e3%81%ae%e4%ba%88%e5%ae%9a%e6%9c%ac%e6%96%87%e3%81%ae%e4%b8%80%e9%83%a8%e3%82%92%e6%96%87%e5%ad%97%e8%a3%85%e9%a3%be%e3%81%99%e3%82%8bvba%e3%83%9e%e3%82%af%e3%83%ad","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=8550","title":{"rendered":"Outlook\u306e\u4e88\u5b9a\u672c\u6587\u306e\u4e00\u90e8\u3092\u6587\u5b57\u88c5\u98fe\u3059\u308bVBA\u30de\u30af\u30ed"},"content":{"rendered":"<p><a href=\"http:\/\/www.excel.studio-kazu.jp\/cgi-bin\/kazuwiki2r.cgi?mycmd=recent\" title=\"\u30a8\u30af\u30bb\u30eb\u8cea\u554f\u63b2\u793a\u677f \u8cea\u554f \u7591\u554f \u4f7f\u3044\u65b9 \u63b2\u793a\u677f \u30a8\u30af\u30bb\u30eb Excel [\u30a8\u30af\u30bb\u30eb\u306e\u5b66\u6821]\" target=\"_blank\">Excel\u306e\u8cea\u554f\u63b2\u793a\u677f<\/a>\u3092\u898b\u305f\u3089\u3001\u300c<a href=\"http:\/\/www.excel.studio-kazu.jp\/kw\/20170608150447.html\" title=\"\u300eEXCEL_VBA\u3067OUTLOOK\u306e\u4e88\u5b9a\u8868\u306e\u672c\u6587\u6587\u5b57\u3092\u592a\u5b57\u5316\u3059\u300f\uff08\u30c1\u30d3\u30f3\u3055\u3093\uff09 \u30a8\u30af\u30bb\u30eb Excel [\u30a8\u30af\u30bb\u30eb\u306e\u5b66\u6821]\" target=\"_blank\">Outlook\u306e\u4e88\u5b9a\u672c\u6587\u306e\u4e00\u90e8\u3092\u30de\u30af\u30ed\u3067\u592a\u5b57\u306b\u3057\u305f\u3044<\/a>\u300d\u3068\u306e\u8cea\u554f\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/answers.microsoft.com\/thread\/8073550e-87da-4237-944f-4214edead937\" title=\"outlook \u30de\u30af\u30ed\u30d5\u30a9\u30f3\u30c8\u306e\u5909\u66f4 - \u30de\u30a4\u30af\u30ed\u30bd\u30d5\u30c8 \u30b3\u30df\u30e5\u30cb\u30c6\u30a3\" target=\"_blank\">\u4f3c\u305f\u3088\u3046\u306a\u8cea\u554f<\/a>\u306b5\u5e74\u307b\u3069\u524d\u306b\u56de\u7b54\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u624b\u306e\u51e6\u7406\u306f<span style=\"color: #ff0000; font-weight: bold;\">\u201cWordEditor = Word\u306eDocument\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u7d4c\u7531\u3067\u51e6\u7406\u3059\u308b\u306e\u304c\u9244\u677f\u201d<\/span>\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub Sample()\r\n  Dim app As Object 'Outlook.Application\r\n  Dim itm As Object 'Outlook.AppointmentItem\r\n  Dim ins As Object 'Outlook.Inspector\r\n  Dim doc As Object 'Word.Document\r\n  Const olAppointmentItem = 1\r\n  Const olEditorWord = 4\r\n  Const olSave = 0\r\n  Const wdBlue = 2\r\n  \r\n  'CreateObject(&quot;Outlook.Application&quot;)\u3067\u306f\u4e0a\u624b\u304f\u51e6\u7406\u3067\u304d\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u305f\u3081\u3001\r\n  '\u5148\u306bOutlook\u3092\u8d77\u52d5\u3057\u3066\u304b\u3089GetObject\u3067\u53d6\u5f97\r\n  '\u203bShell\u3067\u8d77\u52d5\u3057\u3066\u3082\u4e0a\u624b\u304f\u3044\u304b\u306a\u3044\u5834\u5408\u306f\u3001\u624b\u52d5\u3067\u4e8b\u524d\u306bOutlook\u3092\u8d77\u52d5\u3057\u3066\u304a\u304f\r\n  On Error Resume Next\r\n  Set app = GetObject(, &quot;Outlook.Application&quot;)\r\n  If app Is Nothing Then\r\n    Shell &quot;OUTLOOK&quot;, vbNormalFocus\r\n    Do\r\n      Set app = GetObject(, &quot;Outlook.Application&quot;)\r\n      DoEvents\r\n    Loop While app Is Nothing\r\n  End If\r\n  On Error GoTo 0\r\n  \r\n  '\u4e88\u5b9a\u4f5c\u6210\r\n  Set itm = app.CreateItem(olAppointmentItem)\r\n  With itm\r\n    .Subject = &quot;\u30c6\u30b9\u30c8\u4e88\u5b9a&quot;\r\n    .Start = DateAdd(&quot;d&quot;, 1, Now())\r\n    .Display\r\n    Set ins = .GetInspector\r\n  End With\r\n  \r\n  'WordEditor(Document)\u7d4c\u7531\u3067\u4e88\u5b9a\u6587\u5b57\u88c5\u98fe\r\n  If ins.EditorType = olEditorWord Then\r\n    Set doc = ins.WordEditor\r\n    doc.Range.InsertAfter &quot;\u3042\u3044\u3046\u3048\u304a&quot; &amp; vbNewLine &amp; _\r\n                          &quot;\u304b\u304d\u304f\u3051\u3053&quot; &amp; vbNewLine &amp; _\r\n                          &quot;\u3055\u3057\u3059\u305b\u305d&quot;\r\n    With doc.Range(6, 11).Font\r\n      .ColorIndex = wdBlue\r\n      .Bold = True\r\n    End With\r\n  End If\r\n  \r\n  '\u4f5c\u6210\u3057\u305f\u4e88\u5b9a\u3092\u4fdd\u5b58\u3057\u3066\u7d42\u4e86\r\n  itm.Close olSave\r\n  app.Quit\r\nEnd Sub<\/pre>\n<p>\u30b3\u30fc\u30c9\u4e2d\u306b\u30b3\u30e1\u30f3\u30c8\u3068\u3057\u3066\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u304c\u3001Excel VBA\u304b\u3089\u51e6\u7406\u3092\u3059\u308b\u969b\u3001\u300cCreateObject(&#8220;Outlook.Application&#8221;)\u300d\u3067\u65b0\u898f\u306bOutlook\u3092\u8d77\u52d5\u3057\u3066\u51e6\u7406\u3057\u3088\u3046\u3068\u3057\u305f\u5834\u5408\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u4e0a\u624b\u304f\u51e6\u7406\u3067\u304d\u306a\u3044\u3053\u3068\u304c\u3042\u3063\u305f\u305f\u3081\u3001Shell\u95a2\u6570\u3067\u5148\u306bOutlook\u3092\u8d77\u52d5\u3057\u3066\u304b\u3089\u51e6\u7406\u3092\u884c\u3046\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6587\u5b57\u88c5\u98fe\u3092\u884c\u3046\u90e8\u5206\u306b\u95a2\u3057\u3066\u306f\u3001\u8272\u3005\u306a\u66f8\u304d\u65b9\u304c\u3042\u308b\u305f\u3081\u3001\u305d\u306e\u6642\u3005\u306b\u5fdc\u3058\u305f\u51e6\u7406\u3092\u3059\u308b\u306e\u304c\u826f\u3044\u3068\u601d\u3044\u307e\u3059(\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067\u306fWord\u306eRange\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u7d4c\u7531\u3067\u6587\u5b57\u88c5\u98fe\u3057\u3066\u3044\u307e\u3059)\u3002<\/p>\n<div id=\"single_banner_area2\" class=\"clearfix one_banner\">\n<div class=\"single_banner single_banner_left\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u8a18\u4e8b\u4e2d(\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u5e83\u544a\u30e6\u30cb\u30c3\u30c8) -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-7306936664602087\"\r\n     data-ad-slot=\"5429724765\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<\/div>\n<div class=\"single_banner single_banner_right\">\n<a href=\"\" target=\"_blank\"><img decoding=\"async\" src=\"\" alt=\"\" title=\"\" \/><\/a>\n<\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"Excel\u306e\u8cea\u554f\u63b2\u793a\u677f\u3092\u898b\u305f\u3089\u3001\u300cOutlook\u306e\u4e88\u5b9a\u672c\u6587\u306e\u4e00\u90e8\u3092\u30de\u30af\u30ed\u3067\u592a\u5b57\u306b\u3057\u305f\u3044\u300d\u3068\u306e\u8cea\u554f\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u4f3c\u305f\u3088\u3046\u306a\u8cea\u554f\u306b5\u5e74\u307b\u3069\u524d\u306b\u56de\u7b54\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u624b\u306e\u51e6\u7406\u306f\u201cWordEditor = Word\u306e [&hellip;]","protected":false},"author":1,"featured_media":7124,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[Outlook\u306e\u4e88\u5b9a\u672c\u6587\u306e\u4e00\u90e8\u3092\u6587\u5b57\u88c5\u98fe\u3059\u308bVBA\u30de\u30af\u30ed]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,48,68],"tags":[],"class_list":["post-8550","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-outlook"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Outlook.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-2dU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8550"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8550\/revisions"}],"predecessor-version":[{"id":8551,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8550\/revisions\/8551"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7124"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}