{"id":7028,"date":"2016-05-31T11:05:05","date_gmt":"2016-05-31T02:05:05","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=7028"},"modified":"2016-05-31T11:05:05","modified_gmt":"2016-05-31T02:05:05","slug":"office%e3%82%a2%e3%83%89%e3%82%a4%e3%83%b3%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=7028","title":{"rendered":"[Office\u30a2\u30c9\u30a4\u30f3]\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u3002"},"content":{"rendered":"<p>\u300c<a href=\"https:\/\/github.com\/OfficeDev\/Office-Add-in-Dialog-API-Simple-Example\" title=\"Office-Add-in-Dialog-API-Simple-Example\" target=\"_blank\">Office-Add-in-Dialog-API-Simple-Example<\/a>\u300d\u3067<a href=\"http:\/\/dev.office.com\/reference\/add-ins\/shared\/officeui\" title=\"Office Dev Center - Docs - Office UI\" target=\"_blank\">DialogAPI<\/a>\u3092\u4f7f\u3063\u3066Office \u30a2\u30c9\u30a4\u30f3\u304b\u3089\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306f\u73fe\u6642\u70b9(2016\u5e745\u6708)\u3067\u306f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u7248\u306eWord 2016(16.0.6741.0000\u4ee5\u4e0a)\u3057\u304b\u306a\u3044\u3088\u3046\u3067\u3059\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u3069\u3093\u306a\u3082\u306e\u306a\u306e\u304b\u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<h4 class=\"style4a\">\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb<\/h4>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b Id\u3084SourceLocation\u306a\u3069\u306f\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5024\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;OfficeApp xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/appforoffice\/1.1&quot;\r\n  xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;\r\n  xmlns:bt=&quot;http:\/\/schemas.microsoft.com\/office\/officeappbasictypes\/1.0&quot;\r\n  xmlns:ov=&quot;http:\/\/schemas.microsoft.com\/office\/taskpaneappversionoverrides&quot;\r\n  xsi:type=&quot;TaskPaneApp&quot;&gt;\r\n  &lt;Id&gt;e5fe9ce3-1a8d-4743-86ea-e489e6d47d6e&lt;\/Id&gt;\r\n  &lt;Version&gt;1.0.0.0&lt;\/Version&gt;\r\n  &lt;ProviderName&gt;kinuasa&lt;\/ProviderName&gt;\r\n  &lt;DefaultLocale&gt;ja-JP&lt;\/DefaultLocale&gt;\r\n  &lt;DisplayName DefaultValue=&quot;DialogAPI Sample&quot; \/&gt;\r\n  &lt;Description DefaultValue=&quot;DialogAPI Sample&quot;\/&gt;\r\n  &lt;IconUrl DefaultValue=&quot;https:\/\/localhost\/dialog\/icon\/icon_32.png&quot; \/&gt;\r\n  &lt;Hosts&gt;\r\n    &lt;Host Name=&quot;Document&quot; \/&gt;\r\n  &lt;\/Hosts&gt;\r\n  &lt;DefaultSettings&gt;\r\n    &lt;SourceLocation DefaultValue=&quot;https:\/\/localhost\/dialog\/Home.html&quot; \/&gt;\r\n  &lt;\/DefaultSettings&gt;\r\n  &lt;Permissions&gt;ReadWriteDocument&lt;\/Permissions&gt;\r\n  &lt;VersionOverrides xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/taskpaneappversionoverrides&quot; xsi:type=&quot;VersionOverridesV1_0&quot;&gt;\r\n    &lt;Hosts&gt;\r\n      &lt;Host xsi:type=&quot;Document&quot;&gt;\r\n        &lt;DesktopFormFactor&gt;\r\n          &lt;FunctionFile resid=&quot;residDesktopFuncUrl&quot; \/&gt;\r\n          &lt;ExtensionPoint xsi:type=&quot;PrimaryCommandSurface&quot;&gt;\r\n            &lt;OfficeTab id=&quot;TabInsert&quot;&gt;\r\n              &lt;Group id=&quot;grpDialogAPI&quot;&gt;\r\n                &lt;Label resid=&quot;residGrpDialogAPILabel&quot; \/&gt;\r\n                &lt;Icon&gt;\r\n                  &lt;bt:Image size=&quot;16&quot; resid=&quot;residDialogAPIIcon_16&quot; \/&gt;\r\n                  &lt;bt:Image size=&quot;32&quot; resid=&quot;residDialogAPIIcon_32&quot; \/&gt;\r\n                  &lt;bt:Image size=&quot;80&quot; resid=&quot;residDialogAPIIcon_80&quot; \/&gt;\r\n                &lt;\/Icon&gt;\r\n                &lt;Control xsi:type=&quot;Button&quot; id=&quot;btnDialogAPI&quot;&gt;\r\n                  &lt;Label resid=&quot;residBtnDialogAPILabel&quot; \/&gt;\r\n                  &lt;Supertip&gt;\r\n                    &lt;Title resid=&quot;residBtnDialogAPITitle&quot; \/&gt;\r\n                    &lt;Description resid=&quot;residBtnDialogAPIDesc&quot; \/&gt;\r\n                  &lt;\/Supertip&gt;\r\n                  &lt;Icon&gt;\r\n                    &lt;bt:Image size=&quot;16&quot; resid=&quot;residDialogAPIIcon_16&quot; \/&gt;\r\n                    &lt;bt:Image size=&quot;32&quot; resid=&quot;residDialogAPIIcon_32&quot; \/&gt;\r\n                    &lt;bt:Image size=&quot;80&quot; resid=&quot;residDialogAPIIcon_80&quot; \/&gt;\r\n                  &lt;\/Icon&gt;\r\n                  &lt;Action xsi:type=&quot;ExecuteFunction&quot;&gt;\r\n                    &lt;FunctionName&gt;showDialog&lt;\/FunctionName&gt;\r\n                  &lt;\/Action&gt;\r\n                &lt;\/Control&gt;\r\n              &lt;\/Group&gt;\r\n            &lt;\/OfficeTab&gt;\r\n          &lt;\/ExtensionPoint&gt;\r\n        &lt;\/DesktopFormFactor&gt;\r\n      &lt;\/Host&gt;\r\n    &lt;\/Hosts&gt;\r\n    &lt;Resources&gt;\r\n      &lt;bt:Images&gt;\r\n        &lt;bt:Image id=&quot;residDialogAPIIcon_16&quot; DefaultValue=&quot;https:\/\/localhost\/dialog\/icon\/icon_16.png&quot; \/&gt;\r\n        &lt;bt:Image id=&quot;residDialogAPIIcon_32&quot; DefaultValue=&quot;https:\/\/localhost\/dialog\/icon\/icon_32.png&quot; \/&gt;\r\n        &lt;bt:Image id=&quot;residDialogAPIIcon_80&quot; DefaultValue=&quot;https:\/\/localhost\/dialog\/icon\/icon_80.png&quot; \/&gt;\r\n      &lt;\/bt:Images&gt;\r\n      &lt;bt:Urls&gt;\r\n        &lt;bt:Url id=&quot;residDesktopFuncUrl&quot; DefaultValue=&quot;https:\/\/localhost\/dialog\/Func.html&quot; \/&gt;\r\n      &lt;\/bt:Urls&gt;\r\n      &lt;bt:ShortStrings&gt;\r\n        &lt;bt:String id=&quot;residGrpDialogAPILabel&quot; DefaultValue=&quot;Dialog API&quot; \/&gt;\r\n        &lt;bt:String id=&quot;residBtnDialogAPILabel&quot; DefaultValue=&quot;Dialog&quot; \/&gt;\r\n        &lt;bt:String id=&quot;residBtnDialogAPITitle&quot; DefaultValue=&quot;DialogAPI Sample&quot; \/&gt;\r\n      &lt;\/bt:ShortStrings&gt;\r\n      &lt;bt:LongStrings&gt;\r\n        &lt;bt:String id=&quot;residBtnDialogAPIDesc&quot; DefaultValue=&quot;DialogAPI\u306e\u30c6\u30b9\u30c8\u3067\u3059\u3002&quot; \/&gt;\r\n      &lt;\/bt:LongStrings&gt;\r\n    &lt;\/Resources&gt;\r\n  &lt;\/VersionOverrides&gt;\r\n&lt;\/OfficeApp&gt;<\/pre>\n<h4 class=\"style4a\">Home.html<\/h4>\n<pre class=\"brush: xml; 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;meta name=&quot;robots&quot; content=&quot;noindex,nofollow&quot;&gt;\r\n    &lt;title&gt;Dialog API Sample&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;h4&gt;Dialog API Sample&lt;\/h4&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<h4 class=\"style4a\">Func.html<\/h4>\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;meta name=&quot;robots&quot; content=&quot;noindex,nofollow&quot;&gt;\r\n    &lt;title&gt;Dialog API Function&lt;\/title&gt;\r\n    &lt;script src=&quot;https:\/\/code.jquery.com\/jquery-2.2.4.min.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script src=&quot;https:\/\/appsforoffice.microsoft.com\/lib\/1\/hosted\/office.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n        var dialog;\r\n        \r\n        Office.initialize = function(reason){}\r\n        \r\n        function showDialog(event) {\r\n            \/\/\u30c0\u30a4\u30a2\u30ed\u30b0(Dialog.html)\u8868\u793a\r\n            Office.context.ui.displayDialogAsync(&quot;https:\/\/localhost\/dialog\/Dialog.html&quot;, {\r\n                height: 50,\r\n                width: 50\r\n            }, dialogCallback);\r\n        }\r\n        \r\n        function dialogCallback(asyncResult) {\r\n            \/\/\u30c0\u30a4\u30a2\u30ed\u30b0\u4f5c\u6210\u6642\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\r\n            if (asyncResult.status == Office.AsyncResultStatus.Failed) {\r\n                showNotification(asyncResult.error.message);\r\n            } else {\r\n                dialog = asyncResult.value;\r\n                dialog.addEventHandler(Microsoft.Office.WebExtension.EventType.DialogMessageReceived, messageHandler);\r\n                dialog.addEventHandler(Microsoft.Office.WebExtension.EventType.DialogEventReceived, eventHandler);\r\n            }\r\n        }\r\n        \r\n        function messageHandler(arg) {\r\n            \/\/\u30c0\u30a4\u30a2\u30ed\u30b0\u304b\u3089\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u53d7\u3051\u53d6\u308a\r\n            showNotification(arg.message);\r\n            dialog.close();\r\n        }\r\n        \r\n        function eventHandler(arg) {\r\n            switch (arg.error) {\r\n                case 12002:\r\n                    showNotification(&quot;Cannot load URL, 404 not found?&quot;);\r\n                    break;\r\n                case 12003:\r\n                    showNotification(&quot;Invalid URL Syntax&quot;);\r\n                    break;\r\n                case 12004:\r\n                    showNotification(&quot;Domain not in AppDomain list&quot;);\r\n                    break;\r\n                case 12005:\r\n                    showNotification(&quot;HTTPS Required&quot;);\r\n                    break;\r\n                case 12006:\r\n                    showNotification(&quot;Dialog closed&quot;);\r\n                    break;\r\n                case 12007:\r\n                    showNotification(&quot;Dialog already opened&quot;);\r\n                    break;\r\n            }\r\n        }\r\n        \r\n        function showNotification(text) {\r\n            Office.context.document.setSelectedDataAsync(text);\r\n        }\r\n    &lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;h4&gt;Dialog API Function&lt;\/h4&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<h4 class=\"style4a\">Dialog.html<\/h4>\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;meta name=&quot;robots&quot; content=&quot;noindex,nofollow&quot;&gt;\r\n    &lt;title&gt;Dialog API Dialog&lt;\/title&gt;\r\n    &lt;script src=&quot;https:\/\/code.jquery.com\/jquery-2.2.4.min.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script src=&quot;https:\/\/appsforoffice.microsoft.com\/lib\/1\/hosted\/office.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n        Office.initialize = function(reason){}\r\n        $(function(){\r\n            $(&quot;.btnDialog&quot;).click(function(){\r\n                \/\/\u89aa\u3068\u306a\u308b\u30a2\u30c9\u30a4\u30f3\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1\r\n                Office.context.ui.messageParent($(this).val());\r\n            });\r\n        });\r\n    &lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;h4&gt;Dialog API Dialog&lt;\/h4&gt;\r\n    &lt;p&gt;\r\n        &lt;button class=&quot;btnDialog&quot; value=&quot;Hello.&quot;&gt;button 1&lt;\/button&gt;\r\n        &lt;button class=&quot;btnDialog&quot; value=&quot;Good Bye.&quot;&gt;button 2&lt;\/button&gt;\r\n    &lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<h4 class=\"style4a\">\u5b9f\u884c\u753b\u9762<\/h4>\n<p>\u4e0a\u8a18\u30a2\u30c9\u30a4\u30f3\u306e\u5b9f\u884c\u753b\u9762\u304c\u4e0b\u56f3\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/OfficeAdd-in_DialogAPI_01.gif\" alt=\"OfficeAdd-in_DialogAPI_01\" width=\"669\" height=\"610\" class=\"alignnone size-full wp-image-7029\" \/><\/p>\n<p>\u51e6\u7406\u306e\u5927\u307e\u304b\u306a\u6d41\u308c\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p>FunctionName\u8981\u7d20\u3067\u5b9a\u7fa9\u3057\u305f\u300cshowDialog\u300d(Func.html)\u3092\u5b9f\u884c<br \/>\n\u2193<br \/>\ndisplayDialogAsync\u30e1\u30bd\u30c3\u30c9\u306b\u3088\u3063\u3066\u30c0\u30a4\u30a2\u30ed\u30b0(Dialog.html)\u3092\u8868\u793a<br \/>\n\u2193<br \/>\naddEventHandler\u30e1\u30bd\u30c3\u30c9\u306b\u3088\u3063\u3066\u30a4\u30d9\u30f3\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u3051\u53d6\u308c\u308b\u3088\u3046\u306b\u3059\u308b<br \/>\n\u2193<br \/>\n\u8868\u793a\u3055\u308c\u305f\u30c0\u30a4\u30a2\u30ed\u30b0\u304b\u3089messageParent\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u5143\u306e\u30a2\u30c9\u30a4\u30f3\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1<br \/>\n\u2193<br \/>\n\u53d7\u3051\u53d6\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a<\/p>\n<p>\u4e00\u898b\u3084\u3084\u3053\u3057\u3044\u3053\u3068\u3092\u3084\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u4e00\u5ea6\u8a66\u3057\u3066\u307f\u308b\u3068\u3069\u3046\u3044\u3063\u305f\u51e6\u7406\u306a\u306e\u304b\u304c\u5206\u304b\u308a\u307e\u3059\u3002<br \/>\n\u73fe\u72b6\u3067\u306f\u4f7f\u3048\u308b\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3082\u9650\u3089\u308c\u3066\u3044\u308b\u3057\u3001\u5b9f\u969b\u306b\u4f7f\u3046\u5834\u9762\u306f\u306a\u304b\u306a\u304b\u7121\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001Office \u30a2\u30c9\u30a4\u30f3\u3092\u958b\u767a\u3059\u308b\u969b\u306b\u306f\u899a\u3048\u3066\u304a\u3044\u3066\u3082\u640d\u306f\u7121\u3044\u65b0\u6a5f\u80fd\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u300cOffice-Add-in-Dialog-API-Simple-Example\u300d\u3067DialogAPI\u3092\u4f7f\u3063\u3066Office \u30a2\u30c9\u30a4\u30f3\u304b\u3089\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306f [&hellip;]","protected":false},"author":1,"featured_media":7119,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"\u73fe\u6642\u70b9\u3067\u306f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u7248\u306eWord\u3057\u304b\u4f7f\u3048\u307e\u305b\u3093\u3002 [[Office\u30a2\u30c9\u30a4\u30f3]\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b]","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":[130,4,49,128],"tags":[],"class_list":["post-7028","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apps-for-office","category-office","category-word-office","category-office2016"],"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-1Pm","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7028","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=7028"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7028\/revisions"}],"predecessor-version":[{"id":7030,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7028\/revisions\/7030"}],"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=7028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}