{"id":2135,"date":"2012-08-06T16:01:33","date_gmt":"2012-08-06T07:01:33","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=2135"},"modified":"2013-01-30T17:05:04","modified_gmt":"2013-01-30T08:05:04","slug":"javascript-api-for-office%e4%bb%bb%e6%84%8f%e3%81%ae%e5%a0%b4%e6%89%80%e3%81%ab%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%85%a5%e5%8a%9b%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=2135","title":{"rendered":"[Office\u7528\u30a2\u30d7\u30ea]\u4efb\u610f\u306e\u5834\u6240\u306b\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3059\u308b\u3002"},"content":{"rendered":"<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b \u3053\u306e\u60c5\u5831\u306fOffice 2013 \u30ab\u30b9\u30bf\u30de\u30fc \u30d7\u30ec\u30d3\u30e5\u30fc\u7248\u3092\u5143\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u88fd\u54c1\u7248\u3067\u306f\u5909\u66f4\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<p>\u4eca\u56de\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u4efb\u610f\u306e\u5834\u6240\u306b\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/>\n\u4e8b\u524d\u6e96\u5099\u3068\u3057\u3066\u3001Excel\u3092\u958b\u304dSheet1\u306e\u300c<span style=\"color: #ff0000; font-weight: bold;\">$C$2:$E$4<\/span>\u300d\u306e\u7bc4\u56f2\u3092\u300c<span style=\"color: #ff0000; font-weight: bold;\">rngSample<\/span>\u300d\u3068\u3057\u3066\u540d\u524d\u5b9a\u7fa9\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_01-243x300.jpg\" alt=\"\" title=\"Office2013_20_01\" width=\"243\" height=\"300\" class=\"alignnone size-medium wp-image-2136\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_01-243x300.jpg 243w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_01-290x357.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_01-121x150.jpg 121w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_01.jpg 628w\" sizes=\"auto, (max-width: 243px) 100vw, 243px\" \/><\/a><\/p>\n<p>\u305d\u3057\u3066\u30a2\u30d7\u30ea\u306e\u30b3\u30fc\u30c9\u304c\u4e0b\u8a18\u306b\u306a\u308a\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.bindings.addFromNamedItemAsync(&quot;Sheet1!rngSample&quot;, &quot;matrix&quot;, {id:&quot;myRange&quot;}, function (result) {\r\n                        if (result.status == &quot;succeeded&quot;){\r\n                            write(&quot;\u30d0\u30a4\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002:&quot; + result.value.id + &quot; , Type:&quot; + result.value.type);\r\n                        } else {\r\n                            write(&quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002:&quot; + result.error.message);\r\n                        }\r\n                    });\r\n                });\r\n            }\r\n            $(function(){\r\n                $(&quot;#myButton&quot;).click(\r\n                    function() {\r\n                        var ary = &#x5B;\r\n                            &#x5B;1, 2, 3],\r\n                            &#x5B;4, 5, 6],\r\n                            &#x5B;7, 8, 9]\r\n                        ];\r\n                        Office.select(&quot;bindings#myRange&quot;).setDataAsync(ary, {coercionType:&quot;matrix&quot;}, function (result) {\r\n                            if (result.status == &quot;failed&quot;) {\r\n                                write(&quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002:&quot; + result.error.message);\r\n                            }\r\n                        });\r\n                    }\r\n                );\r\n            });\r\n            function write(s) {\r\n                $(&quot;#result&quot;).val(s);\r\n            }\r\n        &lt;\/script&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;input id=&quot;myButton&quot; type=&quot;button&quot; value=&quot;OK&quot;&gt;&lt;br&gt;\r\n        &lt;textarea id=&quot;result&quot; cols=&quot;35&quot; rows=&quot;5&quot;&gt;&lt;\/textarea&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u305f\u30a2\u30d7\u30ea\u3092\u633f\u5165\u5f8c\u300c<span style=\"color: #ff0000; font-weight: bold;\">OK<\/span>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u4e8b\u524d\u306b\u5b9a\u7fa9\u3057\u3066\u304a\u3044\u305f\u300c<span style=\"color: #ff0000; font-weight: bold;\">rngSample<\/span>\u300d\u306e\u7bc4\u56f2\u306b\u30b3\u30fc\u30c9\u4e2d\u306e\u914d\u5217\u300c<span style=\"color: #ff0000; font-weight: bold;\">ary<\/span>\u300d\u3067\u6307\u5b9a\u3057\u305f\u30c7\u30fc\u30bf\u304c\u5165\u529b\u3055\u308c\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_02-300x208.jpg\" alt=\"\" title=\"Office2013_20_02\" width=\"300\" height=\"208\" class=\"alignnone size-medium wp-image-2137\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_02-300x208.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_02-290x201.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_02-150x104.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Office2013_20_02.jpg 879w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306bBindings\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e<span style=\"color: #ff0000; font-weight: bold;\">addFromNamedItemAsync<\/span>\u30e1\u30bd\u30c3\u30c9\u3084\u3001<span style=\"color: #ff0000; font-weight: bold;\">addFromPromptAsync<\/span>\u30e1\u30bd\u30c3\u30c9\u3001<span style=\"color: #ff0000; font-weight: bold;\">addFromSelectionAsync<\/span>\u30e1\u30bd\u30c3\u30c9\u3067\u30d0\u30a4\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u304a\u3051\u3070\u3001Binding\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306esetDataAsync\u30e1\u30bd\u30c3\u30c9\u3067\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3042\u305f\u308a\u306e\u52d5\u4f5c\u306f\u82e5\u5e72\u5206\u304b\u308a\u3065\u3089\u3044\u306e\u3067\u3001\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u52d5\u304b\u3057\u3066\u307f\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p><strong>\u30fbBindings.addFromNamedItemAsync method (apps for Office)<\/strong><br \/>\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/fp123590%28v=office.15%29\" title=\"Bindings.addFromNamedItemAsync method (apps for Office)\" target=\"_blank\">http:\/\/msdn.microsoft.com\/en-us\/library\/fp123590%28v=office.15%29<\/a><br \/>\n<strong>\u30fbBindings.addFromPromptAsync method (apps for Office)<\/strong><br \/>\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/fp142150%28v=office.15%29\" title=\"Bindings.addFromPromptAsync method (apps for Office)\" target=\"_blank\">http:\/\/msdn.microsoft.com\/en-us\/library\/fp142150%28v=office.15%29<\/a><br \/>\n<strong>\u30fbBindings.addFromSelectionAsync method (apps for Office)<\/strong><br \/>\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/fp142282%28v=office.15%29\" title=\"Bindings.addFromSelectionAsync method (apps for Office)\" target=\"_blank\">http:\/\/msdn.microsoft.com\/en-us\/library\/fp142282%28v=office.15%29<\/a><br \/>\n<strong>\u30fbBinding.setDataAsync method (apps for Office)<\/strong><br \/>\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/fp161120%28v=office.15%29\" title=\"Binding.setDataAsync method (apps for Office)\" target=\"_blank\">http:\/\/msdn.microsoft.com\/en-us\/library\/fp161120%28v=office.15%29<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\u203b \u3053\u306e\u60c5\u5831\u306fOffice 2013 \u30ab\u30b9\u30bf\u30de\u30fc \u30d7\u30ec\u30d3\u30e5\u30fc\u7248\u3092\u5143\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u88fd\u54c1\u7248\u3067\u306f\u5909\u66f4\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002 \u4eca\u56de\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u4efb\u610f\u306e\u5834\u6240\u306b\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u4e8b\u524d\u6e96\u5099\u3068\u3057\u3066 [&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-2135","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-yr","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2135","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=2135"}],"version-history":[{"count":4,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2135\/revisions"}],"predecessor-version":[{"id":2665,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2135\/revisions\/2665"}],"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=2135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}