{"id":3195,"date":"2013-07-06T15:54:43","date_gmt":"2013-07-06T06:54:43","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=3195"},"modified":"2013-08-07T17:03:36","modified_gmt":"2013-08-07T08:03:36","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%ba%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e5%90%8d%e3%81%ab%e3%82%88%e3%82%8a%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=3195","title":{"rendered":"[\u30ea\u30dc\u30f3\u30fb\u30ab\u30b9\u30bf\u30de\u30a4\u30ba]\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u3088\u308a\u8868\u793a\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u3092\u5207\u308a\u66ff\u3048\u308b\u3002"},"content":{"rendered":"<p>\u4eca\u56de\u306f\u30ea\u30dc\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u3088\u3063\u3066\u8868\u793a\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u3092\u5207\u308a\u66ff\u3048\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u30ea\u30dc\u30f3XML\uff1a<\/strong><\/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 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;menu id=&quot;mnuSampleA&quot; label=&quot;Menu A&quot; imageMso=&quot;A&quot; size=&quot;large&quot; itemSize=&quot;large&quot; getVisible=&quot;mnuSample_getVisible&quot; tag=&quot;GroupA&quot;&gt;\r\n            &lt;button id=&quot;btnSample1&quot; label=&quot;Button 1&quot; imageMso=&quot;Spade&quot; \/&gt;\r\n            &lt;button id=&quot;btnSample2&quot; label=&quot;Button 2&quot; imageMso=&quot;Spade&quot; \/&gt;\r\n            &lt;button id=&quot;btnSample3&quot; label=&quot;Button 3&quot; imageMso=&quot;Spade&quot; \/&gt;\r\n          &lt;\/menu&gt;\r\n          &lt;menu id=&quot;mnuSampleB&quot; label=&quot;Menu B&quot; imageMso=&quot;B&quot; size=&quot;large&quot; itemSize=&quot;large&quot; getVisible=&quot;mnuSample_getVisible&quot; tag=&quot;GroupB&quot;&gt;\r\n            &lt;button id=&quot;btnSample4&quot; label=&quot;Button 4&quot; imageMso=&quot;Heart&quot; \/&gt;\r\n            &lt;button id=&quot;btnSample5&quot; label=&quot;Button 5&quot; imageMso=&quot;Heart&quot; \/&gt;\r\n            &lt;button id=&quot;btnSample6&quot; label=&quot;Button 6&quot; imageMso=&quot;Heart&quot; \/&gt;\r\n          &lt;\/menu&gt;\r\n          &lt;menu id=&quot;mnuSampleC&quot; label=&quot;Menu C&quot; imageMso=&quot;C&quot; size=&quot;large&quot; itemSize=&quot;large&quot; getVisible=&quot;mnuSample_getVisible&quot; tag=&quot;GroupC&quot;&gt;\r\n            &lt;button id=&quot;btnSample7&quot; label=&quot;Button 7&quot; imageMso=&quot;Club&quot; \/&gt;\r\n            &lt;button id=&quot;btnSample8&quot; label=&quot;Button 8&quot; imageMso=&quot;Club&quot; \/&gt;\r\n            &lt;button id=&quot;btnSample9&quot; label=&quot;Button 9&quot; imageMso=&quot;Club&quot; \/&gt;\r\n          &lt;\/menu&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<p><strong>VBA\u30b3\u30fc\u30c9\uff1a<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub mnuSample_getVisible(control As IRibbonControl, ByRef returnedVal)\r\n  Dim grpName As String\r\n  \r\n  '\u30e6\u30fc\u30b6\u30fc\u540d\u304b\u3089\u30b0\u30eb\u30fc\u30d7\u540d\u3092\u53d6\u5f97\r\n  Select Case VBA.Environ$(&quot;USERNAME&quot;)\r\n    Case &quot;Admin&quot;: grpName = &quot;GroupA&quot;\r\n    Case &quot;User&quot;: grpName = &quot;GroupB&quot;\r\n    Case Else: grpName = &quot;GroupC&quot;\r\n  End Select\r\n  \r\n  'tag\u5c5e\u6027\u306b\u8a18\u8f09\u3057\u305f\u30b0\u30eb\u30fc\u30d7\u540d\u306b\u3088\u308a\u8868\u793a\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u3092\u5224\u5225\r\n  Select Case control.Tag\r\n    Case grpName: returnedVal = True\r\n    Case Else: returnedVal = False\r\n  End Select\r\nEnd Sub<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3068\u3001\u4e0b\u56f3\u306e\u3088\u3046\u306b\u30e6\u30fc\u30b6\u30fc\u540d\u304c\u300c<span style=\"color: #ff0000; font-weight: bold;\">Admin<\/span>\u300d\u306e\u3068\u304d\u306f\u300c<span style=\"color: #ff0000; font-weight: bold;\">Menu A<\/span>\u300d\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u304c\u300c<span style=\"color: #ff0000; font-weight: bold;\">User<\/span>\u300d\u306e\u3068\u304d\u306f\u300c<span style=\"color: #ff0000; font-weight: bold;\">Menu B<\/span>\u300d\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u304c\u305d\u308c\u4ee5\u5916\u306e\u6642\u306f\u300c<span style=\"color: #ff0000; font-weight: bold;\">Menu C<\/span>\u300d\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/mnu_getVisible_01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/mnu_getVisible_01-300x106.png\" alt=\"mnu_getVisible_01\" width=\"300\" height=\"106\" class=\"alignnone size-medium wp-image-3196\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/mnu_getVisible_01-300x106.png 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/mnu_getVisible_01-290x102.png 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/mnu_getVisible_01-150x53.png 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/mnu_getVisible_01.png 890w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067\u306f\u3001getVisible\u5c5e\u6027\u3067\u52d5\u7684\u306b\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u5fdc\u3058\u3066\u632f\u308a\u5206\u3051\u305f\u30b0\u30eb\u30fc\u30d7\u540d(\u9069\u5f53\u306b\u8a2d\u5b9a)\u306b\u3088\u3063\u3066\u3001\u8868\u793a\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u3092\u5224\u5225\u3059\u308b\u4ed5\u7d44\u307f\u306b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4e0a\u8a18\u3067\u306fmenu\u8981\u7d20\u306bgetVisible\u5c5e\u6027\u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u304c\u3001menu\u8981\u7d20\u306b\u9650\u3089\u305atab\u3084button\u7b49\u306e\u8981\u7d20\u3067\u3082\u540c\u69d8\u306e\u51e6\u7406\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u5916\u90e8(\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3084CSV\u30d5\u30a1\u30a4\u30eb\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7b49\u3001\u4e0b\u8a18\u306e\u5834\u5408\u306fXML\u30d5\u30a1\u30a4\u30eb)\u304b\u3089\u30e6\u30fc\u30b6\u30fc\u306e\u60c5\u5831\u3092\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3057\u3066\u304a\u3051\u3070\u3001\u5236\u5fa1\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u5834\u5408\u3067\u3082\u5916\u90e8\u306e\u30d5\u30a1\u30a4\u30eb\u3084\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u3060\u3051\u3067\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>users.xml(\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3068\u540c\u3058\u5834\u6240\u306b\u4fdd\u5b58)\uff1a<\/strong><\/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;users&gt;\r\n  &lt;user name=&quot;Admin&quot; group=&quot;GroupA&quot; \/&gt;\r\n  &lt;user name=&quot;User&quot; group=&quot;GroupB&quot; \/&gt;\r\n  &lt;user name=&quot;Kinuasa&quot; group=&quot;GroupC&quot; \/&gt;\r\n&lt;\/users&gt;<\/pre>\n<p><strong>VBA\u30b3\u30fc\u30c9(Word)\uff1a<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub mnuSample_getVisible(control As IRibbonControl, ByRef returnedVal)\r\n  Dim grpName As String\r\n  Dim usrName As String\r\n  Dim CfgFilePath As String\r\n  Dim n As Object\r\n  Const CfgFileName As String = &quot;users.xml&quot;\r\n  \r\n  grpName = &quot;&quot;: Set n = Nothing '\u521d\u671f\u5316\r\n  usrName = VBA.Environ$(&quot;USERNAME&quot;)\r\n  \r\n  '\u5916\u90e8\u306e\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30b0\u30eb\u30fc\u30d7\u540d\u3092\u53d6\u5f97\r\n  CfgFilePath = ThisDocument.Path &amp; Application.PathSeparator &amp; CfgFileName\r\n  On Error Resume Next\r\n  If Len(Trim$(Dir$(CfgFilePath))) &gt; 0 Then\r\n    With CreateObject(&quot;Msxml2.DOMDocument&quot;)\r\n      .async = False\r\n      If .Load(CfgFilePath) Then\r\n        Set n = .SelectSingleNode(&quot;\/users\/user&#x5B;@name='&quot; &amp; usrName &amp; &quot;']&quot;)\r\n        If Not n Is Nothing Then\r\n          grpName = n.Attributes(1).NodeValue\r\n        End If\r\n      End If\r\n    End With\r\n  End If\r\n  On Error GoTo 0\r\n  \r\n  'tag\u5c5e\u6027\u306b\u8a18\u8f09\u3057\u305f\u30b0\u30eb\u30fc\u30d7\u540d\u306b\u3088\u308a\u8868\u793a\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u3092\u5224\u5225\r\n  Select Case control.Tag\r\n    Case grpName: returnedVal = True\r\n    Case Else: returnedVal = False\r\n  End Select\r\nEnd Sub<\/pre>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306bgetVisible\u5c5e\u6027\u3067\u8868\u793a\u30fb\u975e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u52d5\u7684\u306bXML\u3092\u5207\u308a\u66ff\u3048\u305f\u3044\u5834\u5408\u306b\u306f\u3001\u4e0b\u8a18\u30da\u30fc\u30b8\u3067\u7d39\u4ecb\u3057\u3066\u3044\u308b\u3088\u3046\u306bdynamicMenu\u8981\u7d20\u306egetContent\u5c5e\u6027\u3092\u4f7f\u3046\u3053\u3068\u3092\u304a\u85a6\u3081\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u30fb\u5916\u90e8\u306eXML\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u5fdc\u3058\u3066menu\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b<\/strong><br \/>\n<a href=\"\/\/www.ka-net.org\/blog\/?p=196\" title=\"\u5916\u90e8\u306eXML\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u5fdc\u3058\u3066menu\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\" target=\"_blank\">\/\/www.ka-net.org\/blog\/?p=196<\/a><br \/>\n<strong>\u30fbmenu\u5185\u306b\u3042\u308bbutton\u306e\u6570\u3092\u5897\u3084\u3059<\/strong><br \/>\n<a href=\"\/\/www.ka-net.org\/blog\/?p=207\" title=\"menu\u5185\u306b\u3042\u308bbutton\u306e\u6570\u3092\u5897\u3084\u3059\" target=\"_blank\">\/\/www.ka-net.org\/blog\/?p=207<\/a><br \/>\n<strong>\u30fb\u30ea\u30dc\u30f3\u304b\u3089\u30d7\u30ea\u30f3\u30bf\u3092\u9078\u629e\u3057\u3066\u7c21\u5358\u306b\u5370\u5237\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b(Word)<\/strong><br \/>\n<a href=\"\/\/www.ka-net.org\/blog\/?p=234\" title=\"\u30ea\u30dc\u30f3\u304b\u3089\u30d7\u30ea\u30f3\u30bf\u3092\u9078\u629e\u3057\u3066\u7c21\u5358\u306b\u5370\u5237\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b(Word)\" target=\"_blank\">\/\/www.ka-net.org\/blog\/?p=234<\/a><br \/>\n<strong>\u30fb\u30e1\u30cb\u30e5\u30fc\u306e\u5185\u5bb9\u3092\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b<\/strong><br \/>\n<a href=\"\/\/www.ka-net.org\/ribbon\/ri70.html\" title=\"\u30e1\u30cb\u30e5\u30fc\u306e\u5185\u5bb9\u3092\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b\" target=\"_blank\">\/\/www.ka-net.org\/ribbon\/ri70.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\u4eca\u56de\u306f\u30ea\u30dc\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u3088\u3063\u3066\u8868\u793a\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u3092\u5207\u308a\u66ff\u3048\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30ea\u30dc\u30f3XML\uff1a &lt;?xml version=&quot;1.0&quot; encoding=&#038;qu [&hellip;]","protected":false},"author":1,"featured_media":7130,"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":[4,1],"tags":[7,11,12],"class_list":["post-3195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-ribbon","tag-ribbon-2","tag-office-2","tag-12"],"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-Px","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3195","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=3195"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3195\/revisions"}],"predecessor-version":[{"id":3198,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3195\/revisions\/3198"}],"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=3195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}