{"id":2441,"date":"2012-11-02T16:09:54","date_gmt":"2012-11-02T07:09:54","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=2441"},"modified":"2012-11-02T16:09:54","modified_gmt":"2012-11-02T07:09:54","slug":"office%e7%94%a8%e3%82%a2%e3%83%97%e3%83%aa%e3%81%a7%e3%81%afalert%e3%82%84confirm%e3%81%8c%e4%bd%bf%e3%81%88%e3%81%aa%e3%81%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=2441","title":{"rendered":"Office\u7528\u30a2\u30d7\u30ea\u3067\u306falert\u3084confirm\u304c\u4f7f\u3048\u306a\u3044\uff1f"},"content":{"rendered":"<p>JavaScript\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u3084\u78ba\u8a8d\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u969b\u306b\u306f\u300c<strong>alert<\/strong>\u300d\u3084\u300c<strong>confirm<\/strong>\u300d\u3001\u300c<strong>prompt<\/strong>\u300d\u304c\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u3089\u306fOffice\u7528\u30a2\u30d7\u30ea\u3067\u4f7f\u7528\u3067\u304d\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f<br \/>\n\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n        &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=Edge&quot;&gt;\r\n        &lt;script src=&quot;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.7.2\/jquery.min.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script src=&quot;https:\/\/az88874.vo.msecnd.net\/api\/1.0\/office.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script&gt;\r\n            Office.initialize = function(reason){\r\n                $(document).ready(function(){\r\n                    Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, document_SelectionChanged);\r\n                });\r\n            }\r\n            function document_SelectionChanged(eventArgs) {\r\n                $(&quot;#result&quot;).val(eventArgs.type);\r\n                window.alert(&quot;aaa&quot;);\r\n                window.confirm(&quot;bbb&quot;);\r\n                window.prompt(&quot;ccc&quot;,&quot;ddd&quot;);\r\n            }\r\n        &lt;\/script&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;textarea id=&quot;result&quot; rows=&quot;4&quot; cols=&quot;30&quot;&gt;&lt;\/textarea&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306fSelectionChanged\u30a4\u30d9\u30f3\u30c8\u3092\u5229\u7528\u3057\u3066\u9078\u629e\u304c\u5909\u66f4\u3055\u308c\u305f\u3068\u304d\u306b\u51e6\u7406\u3092\u884c\u3046\u3082\u306e\u3067\u3059\u304c\u3001\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068textarea\u3078\u306e\u66f8\u304d\u8fbc\u307f\u306f\u884c\u308f\u308c\u308b\u3082\u306e\u306e\u3001\u305d\u308c\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u5b9f\u884c\u3055\u308c\u306a\u3044\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<br \/>\n\u3069\u3046\u3084\u3089Office\u7528\u30a2\u30d7\u30ea\u3067\u306falert\u3084confirm\u3001prompt\u306f\u4f7f\u7528\u3067\u304d\u306a\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3063\u3066\u3082\u3001\u4e0b\u8a18\u30b3\u30fc\u30c9\u306e\u3088\u3046\u306bVBScript\u3092\u901a\u3057\u3066\u3057\u307e\u3048\u3070MsgBox\u3084InputBox\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u7c21\u5358\u306b\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u65b9\u6cd5\u304c\u304a\u85a6\u3081\u3067\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n        &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=Edge&quot;&gt;\r\n        &lt;script src=&quot;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.7.2\/jquery.min.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script src=&quot;https:\/\/az88874.vo.msecnd.net\/api\/1.0\/office.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script&gt;\r\n            Office.initialize = function(reason){\r\n                $(document).ready(function(){\r\n                    Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, document_SelectionChanged);\r\n                });\r\n            }\r\n            function document_SelectionChanged(eventArgs) {\r\n                $(&quot;#result&quot;).val(eventArgs.type);\r\n                msgBoxVbs(&quot;eee&quot;, 3 + 64, &quot;fff&quot;);\r\n                inputBoxVbs(&quot;ggg&quot;, &quot;hhh&quot;, &quot;iii&quot;);\r\n            }\r\n        &lt;\/script&gt;\r\n        &lt;script language=&quot;vbscript&quot;&gt;\r\n            Function msgBoxVbs(prompt, buttons, title)\r\n                msgBoxVbs = MsgBox(prompt, buttons, title)\r\n            End Function\r\n            \r\n            Function inputBoxVbs(prompt, title, default)\r\n                inputBoxVbs = InputBox(prompt, title, default)\r\n            End Function\r\n        &lt;\/script&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;textarea id=&quot;result&quot; rows=&quot;4&quot; cols=&quot;30&quot;&gt;&lt;\/textarea&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"JavaScript\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u3084\u78ba\u8a8d\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u969b\u306b\u306f\u300calert\u300d\u3084\u300cconfirm\u300d\u3001\u300cprompt\u300d\u304c\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u3089\u306fOffice\u7528\u30a2\u30d7\u30ea\u3067\u4f7f\u7528\u3067\u304d\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f \u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u30c6\u30b9\u30c8 [&hellip;]","protected":false},"author":1,"featured_media":7119,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[130,4,79],"tags":[74,77],"class_list":["post-2441","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apps-for-office","category-office","category-office2013","tag-office-2013","tag-apps-for-office"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-OfficeAddins.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-Dn","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2441","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=2441"}],"version-history":[{"count":3,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2441\/revisions"}],"predecessor-version":[{"id":2444,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2441\/revisions\/2444"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7119"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}