{"id":7532,"date":"2016-10-23T18:12:52","date_gmt":"2016-10-23T09:12:52","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=7532"},"modified":"2016-10-23T18:12:52","modified_gmt":"2016-10-23T09:12:52","slug":"%e3%83%aa%e3%83%9c%e3%83%b3%e3%83%bb%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%badropdown%e8%a6%81%e7%b4%a0%e3%81%ae%e5%88%9d%e6%9c%9f%e9%a0%85%e7%9b%ae%e3%82%92%e6%8c%87%e5%ae%9a%e3%81%99","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=7532","title":{"rendered":"[\u30ea\u30dc\u30f3\u30fb\u30ab\u30b9\u30bf\u30de\u30a4\u30ba]dropDown\u8981\u7d20\u306e\u521d\u671f\u9805\u76ee\u3092\u6307\u5b9a\u3059\u308b\u3002"},"content":{"rendered":"<p>MSDN \u30d5\u30a9\u30fc\u30e9\u30e0\u306b\u300c<a href=\"https:\/\/social.msdn.microsoft.com\/Forums\/ja-JP\/vbajp\/thread\/285c415d-d25c-4235-a3ed-f69d5a1170cb\" title=\"\u30ea\u30dc\u30f3:\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u30ea\u30b9\u30c8\u306blabel\u521d\u671f\u5024\u3092\u8868\u793a\" target=\"_blank\">\u30ea\u30dc\u30f3:\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u30ea\u30b9\u30c8\u306blabel\u521d\u671f\u5024\u3092\u8868\u793a<\/a>\u300d\u3068\u3044\u3046\u8cea\u554f\u304c\u3042\u308a\u307e\u3057\u305f\u3002<br \/>\nExcel\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u3068\u304d\u306b\u3001\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u306e\u521d\u671f\u5024\u3092\u6307\u5b9a\u3057\u305f\u3044\u3001\u3068\u3044\u3046\u8cea\u554f\u3067\u3059\u3002<\/p>\n<p>\u3053\u3046\u3044\u3063\u305f\u5834\u5408\u306f\u3001dropDown\u8981\u7d20\u306e<span style=\"color: #ff0000; font-weight: bold;\">getSelectedItemID<\/span>\u5c5e\u6027\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3067\u5b50\u8981\u7d20\u306eid\u3092\u6307\u5b9a\u3001\u3082\u3057\u304f\u306f<span style=\"color: #ff0000; font-weight: bold;\">getSelectedItemIndex<\/span>\u5c5e\u6027\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3067\u5b50\u8981\u7d20\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u5bfe\u5fdc\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h4 class=\"style4a\">\u5b50\u8981\u7d20\u306eid\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408<\/h4>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;customUI xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/2006\/01\/customui&quot;&gt;\r\n  &lt;ribbon&gt;\r\n    &lt;tabs&gt;\r\n      &lt;tab id=&quot;tabSample&quot; label=&quot;Sample Tab&quot;&gt;\r\n        &lt;group id=&quot;grpSample&quot; label=&quot;Sample Group&quot;&gt;\r\n          &lt;dropDown id=&quot;ddnSample&quot; label=&quot;Sample&quot; getSelectedItemID=&quot;ddnSample_getSelectedItemID&quot;&gt;\r\n            &lt;item id=&quot;itm1&quot; label=&quot;Item 01&quot; \/&gt;\r\n            &lt;item id=&quot;itm2&quot; label=&quot;Item 02&quot; \/&gt;\r\n            &lt;item id=&quot;itm3&quot; label=&quot;Item 03&quot; \/&gt;\r\n          &lt;\/dropDown&gt;\r\n        &lt;\/group&gt;\r\n      &lt;\/tab&gt;\r\n    &lt;\/tabs&gt;\r\n  &lt;\/ribbon&gt;\r\n&lt;\/customUI&gt;<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub ddnSample_getSelectedItemID(control As IRibbonControl, ByRef returnedVal)\r\n  returnedVal = &quot;itm2&quot;\r\nEnd Sub<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/dropDown_getSelectedItemID_01.jpg\" alt=\"dropdown_getselecteditemid_01\" width=\"164\" height=\"100\" class=\"alignnone size-full wp-image-7533\" \/><\/p>\n<h4 class=\"style4a\">\u5b50\u8981\u7d20\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408<\/h4>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;customUI xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/2006\/01\/customui&quot;&gt;\r\n  &lt;ribbon&gt;\r\n    &lt;tabs&gt;\r\n      &lt;tab id=&quot;tabSample&quot; label=&quot;Sample Tab&quot;&gt;\r\n        &lt;group id=&quot;grpSample&quot; label=&quot;Sample Group&quot;&gt;\r\n          &lt;dropDown id=&quot;ddnSample&quot; label=&quot;Sample&quot; getSelectedItemIndex=&quot;ddnSample_getSelectedItemIndex&quot;&gt;\r\n            &lt;item id=&quot;itm1&quot; label=&quot;Item 01&quot; \/&gt;\r\n            &lt;item id=&quot;itm2&quot; label=&quot;Item 02&quot; \/&gt;\r\n            &lt;item id=&quot;itm3&quot; label=&quot;Item 03&quot; \/&gt;\r\n          &lt;\/dropDown&gt;\r\n        &lt;\/group&gt;\r\n      &lt;\/tab&gt;\r\n    &lt;\/tabs&gt;\r\n  &lt;\/ribbon&gt;\r\n&lt;\/customUI&gt;<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub ddnSample_getSelectedItemIndex(control As IRibbonControl, ByRef returnedVal)\r\n  returnedVal = 2\r\nEnd Sub<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/dropDown_getSelectedItemID_02.jpg\" alt=\"dropdown_getselecteditemid_02\" width=\"158\" height=\"100\" class=\"alignnone size-full wp-image-7534\" \/><\/p>\n<h4 class=\"style4a\">dropDown\u8981\u7d20\u306e\u5b50\u8981\u7d20\u3092\u52d5\u7684\u306b\u8a2d\u5b9a\u3059\u308b\u5834\u5408<\/h4>\n<p>\u4e0a\u8a18\u4f8b\u3067\u306fdropDown\u8981\u7d20\u306e\u5b50\u8981\u7d20\u3068\u3057\u3066item\u8981\u7d20\u3092\u5b9a\u7fa9\u3057\u307e\u3057\u305f\u304c\u3001getItemCount\u3001getItemID\u3001getItemLabel\u3068\u3044\u3063\u305f\u5c5e\u6027\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u3053\u308c\u3089\u3092\u52d5\u7684\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/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;customUI onLoad=&quot;rbnSample_onLoad&quot; xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/2006\/01\/customui&quot;&gt;\r\n  &lt;ribbon&gt;\r\n    &lt;tabs&gt;\r\n      &lt;tab id=&quot;tabSample&quot; label=&quot;Sample Tab&quot;&gt;\r\n        &lt;group id=&quot;grpSample&quot; label=&quot;Sample Group&quot;&gt;\r\n          &lt;dropDown id=&quot;ddnSample&quot; label=&quot;Sample&quot; \r\n                    getItemCount=&quot;ddnSample_getItemCount&quot;\r\n                    getItemID=&quot;ddnSample_getItemID&quot;\r\n                    getItemLabel=&quot;ddnSample_getItemLabel&quot;\r\n                    getSelectedItemID=&quot;ddnSample_getSelectedItemID&quot;\r\n                    onAction=&quot;ddnSample_onAction&quot; \/&gt;\r\n        &lt;\/group&gt;\r\n      &lt;\/tab&gt;\r\n    &lt;\/tabs&gt;\r\n  &lt;\/ribbon&gt;\r\n&lt;\/customUI&gt;<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPrivate itm As Variant\r\n\r\nPublic Sub rbnSample_onLoad(ribbon As IRibbonUI)\r\n  '\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u9805\u76ee\u3092\u914d\u5217\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002\r\n  itm = Array(&quot;\u30ea\u30f3\u30b4&quot;, &quot;\u30d0\u30ca\u30ca&quot;, &quot;\u30d1\u30a4\u30ca\u30c3\u30d7\u30eb&quot;, &quot;\u30a4\u30c1\u30b4&quot;)\r\nEnd Sub\r\n\r\nPublic Sub ddnSample_getItemCount(control As IRibbonControl, ByRef returnedVal)\r\n  '\u914d\u5217\u306e\u8981\u7d20\u6570\u304b\u3089\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u306e\u9805\u76ee\u6570\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\r\n  returnedVal = UBound(itm) + 1\r\nEnd Sub\r\n\r\nPublic Sub ddnSample_getItemID(control As IRibbonControl, index As Integer, ByRef returnedVal)\r\n  '\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u306e\u5404\u9805\u76ee\u306eID\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\r\n  returnedVal = &quot;itm&quot; &amp; index\r\nEnd Sub\r\n\r\nPublic Sub ddnSample_getItemLabel(control As IRibbonControl, index As Integer, ByRef returnedVal)\r\n  '\u914d\u5217\u306b\u683c\u7d0d\u3057\u305f\u6587\u5b57\u5217\u304b\u3089\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u306e\u5404\u9805\u76ee\u306e\u30e9\u30d9\u30eb\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\r\n  returnedVal = itm(index)\r\nEnd Sub\r\n\r\nPublic Sub ddnSample_getSelectedItemID(control As IRibbonControl, ByRef returnedVal)\r\n  '\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u9078\u629e\u3055\u308c\u308b\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u306e\u9805\u76ee\u3092ID\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\r\n  returnedVal = &quot;itm2&quot;\r\nEnd Sub\r\n\r\nPublic Sub ddnSample_onAction(control As IRibbonControl, id As String, index As Integer)\r\n  MsgBox &quot;id:&quot; &amp; id &amp; vbNewLine &amp; _\r\n         &quot;index:&quot; &amp; index &amp; vbNewLine &amp; _\r\n         itm(index), vbInformation + vbSystemModal\r\nEnd Sub<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/dropDown_getSelectedItemID_03.jpg\" alt=\"dropdown_getselecteditemid_03\" width=\"163\" height=\"141\" class=\"alignnone size-full wp-image-7535\" \/><\/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":"MSDN \u30d5\u30a9\u30fc\u30e9\u30e0\u306b\u300c\u30ea\u30dc\u30f3:\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u30ea\u30b9\u30c8\u306blabel\u521d\u671f\u5024\u3092\u8868\u793a\u300d\u3068\u3044\u3046\u8cea\u554f\u304c\u3042\u308a\u307e\u3057\u305f\u3002 Excel\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u3068\u304d\u306b\u3001\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u306e\u521d\u671f\u5024\u3092\u6307\u5b9a\u3057\u305f\u3044\u3001\u3068\u3044\u3046\u8cea\u554f\u3067\u3059\u3002 \u3053\u3046\u3044\u3063\u305f\u5834 [&hellip;]","protected":false},"author":1,"featured_media":7130,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[[\u30ea\u30dc\u30f3\u30fb\u30ab\u30b9\u30bf\u30de\u30a4\u30ba]dropDown\u8981\u7d20\u306e\u521d\u671f\u9805\u76ee\u3092\u6307\u5b9a\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":[4,1],"tags":[],"class_list":["post-7532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-ribbon"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Ribbon.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1Xu","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7532","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=7532"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7532\/revisions"}],"predecessor-version":[{"id":7536,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7532\/revisions\/7536"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7130"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}