{"id":6363,"date":"2015-10-19T15:57:47","date_gmt":"2015-10-19T06:57:47","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=6363"},"modified":"2015-10-19T22:19:31","modified_gmt":"2015-10-19T13:19:31","slug":"vba%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%95%e3%82%a9%e3%83%bc%e3%83%a0%e3%81%a7bootstrap%e3%82%92%e4%bd%bf%e3%81%86%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=6363","title":{"rendered":"[VBA]\u30e6\u30fc\u30b6\u30fc\u30d5\u30a9\u30fc\u30e0\u3067Bootstrap\u3092\u4f7f\u3046\u3002"},"content":{"rendered":"<p>MSDN\u30d5\u30a9\u30fc\u30e9\u30e0\u306b\u3042\u3063\u305f\u8cea\u554f\u300c<a href=\"https:\/\/social.msdn.microsoft.com\/Forums\/ja-JP\/vbajp\/thread\/7387cb4c-f17e-4d4e-a039-6164780253e5\" title=\"VBA\u3067\u306e\u30d5\u30a9\u30fc\u30e0 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7acb\u4f53\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u304b\u3089\u5e73\u9762\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u306b\u3057\u305f\u3044\" target=\"_blank\">VBA\u3067\u306e\u30d5\u30a9\u30fc\u30e0 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7acb\u4f53\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u304b\u3089\u5e73\u9762\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u306b\u3057\u305f\u3044<\/a>\u300d\u7528\u306b\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b 64\u30d3\u30c3\u30c8\u7248Office\u3067\u5b9f\u884c\u3059\u308b\u5834\u5408\u306f\u8981\u4fee\u6b63<\/span><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">'UserForm1\r\n'\u203b WebBrowser\u30b3\u30f3\u30c8\u30c8\u30fc\u30eb\u8981\u914d\u7f6e\r\n'\u203b Microsoft HTML Object Library(mshtml.tlb)\u8981\u53c2\u7167\r\n\r\nOption Explicit\r\n\r\nPrivate Declare Function GetWindowLong Lib &quot;user32&quot; Alias &quot;GetWindowLongA&quot; (ByVal hwnd As Long, ByVal nIndex As Long) As Long\r\nPrivate Declare Function SetWindowLong Lib &quot;user32&quot; Alias &quot;SetWindowLongA&quot; (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long\r\nPrivate Declare Function WindowFromAccessibleObject Lib &quot;oleacc&quot; (ByVal pacc As Office.IAccessible, ByRef phwnd As Long) As Long\r\n\r\nPrivate WithEvents btn1 As MSHTML.HTMLButtonElement\r\nPrivate WithEvents btn2 As MSHTML.HTMLButtonElement\r\nPrivate WithEvents btn3 As MSHTML.HTMLButtonElement\r\nPrivate WithEvents btn4 As MSHTML.HTMLButtonElement\r\n\r\nPrivate Sub UserForm_Initialize()\r\n  SetFormStyle\r\n  RenderHtml\r\nEnd Sub\r\n\r\nPrivate Sub SetFormStyle()\r\n'\u30e6\u30fc\u30b6\u30fc\u30d5\u30a9\u30fc\u30e0\u306e\u5916\u89b3\u8a2d\u5b9a\r\n  Dim hForm As Long\r\n  Dim style As Long\r\n \r\n  WindowFromAccessibleObject Me, hForm\r\n  If hForm &lt;&gt; 0 Then\r\n    style = GetWindowLong(hForm, -16)\r\n    style = style Or &amp;H40000\r\n    SetWindowLong hForm, -16, style\r\n  End If\r\nEnd Sub\r\n\r\nPrivate Sub RenderHtml()\r\n'WebBrowser\u306bHTML\u63cf\u753b\r\n  Dim d As MSHTML.HTMLDocument\r\n  Dim src As String\r\n \r\n  With Me.WebBrowser1\r\n    .Navigate &quot;about:blank&quot;\r\n    While .Busy Or .ReadyState &lt;&gt; READYSTATE_COMPLETE\r\n      DoEvents\r\n    Wend\r\n    Set d = .Document\r\n  End With\r\n \r\n  src = &quot;&lt;!DOCTYPE html&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;&lt;html lang=&quot;&quot;ja&quot;&quot;&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;&lt;head&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;meta charset=&quot;&quot;utf-8&quot;&quot;&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;meta http-equiv=&quot;&quot;X-UA-Compatible&quot;&quot; content=&quot;&quot;IE=edge&quot;&quot;&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;link rel=&quot;&quot;stylesheet&quot;&quot; href=&quot;&quot;https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.5\/css\/bootstrap.min.css&quot;&quot;&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;link rel=&quot;&quot;stylesheet&quot;&quot; href=&quot;&quot;https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.5\/css\/bootstrap-theme.min.css&quot;&quot;&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;script src=&quot;&quot;https:\/\/code.jquery.com\/jquery-1.11.3.min.js&quot;&quot;&gt;&lt;\/script&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;script src=&quot;&quot;https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.5\/js\/bootstrap.min.js&quot;&quot;&gt;&lt;\/script&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;style&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;    *{padding:5px;}&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;\/style&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;&lt;\/head&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;&lt;body&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;  &lt;div class=&quot;&quot;container&quot;&quot;&gt;&quot; &amp; vbNewLine\r\n \r\n  '\u30dc\u30bf\u30f3\u8ffd\u52a0\r\n  src = src &amp; &quot;    &lt;button id=&quot;&quot;button1&quot;&quot; class=&quot;&quot;btn btn-primary&quot;&quot;&gt;&lt;span class=&quot;&quot;glyphicon glyphicon-globe&quot;&quot;&gt;&lt;\/span&gt;button1&lt;\/button&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;    &lt;button id=&quot;&quot;button2&quot;&quot; class=&quot;&quot;btn btn-success&quot;&quot;&gt;&lt;span class=&quot;&quot;glyphicon glyphicon-cutlery&quot;&quot;&gt;&lt;\/span&gt;button2&lt;\/button&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;    &lt;button id=&quot;&quot;button3&quot;&quot; class=&quot;&quot;btn btn-info&quot;&quot;&gt;&lt;span class=&quot;&quot;glyphicon glyphicon-folder-open&quot;&quot;&gt;&lt;\/span&gt;button3&lt;\/button&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;    &lt;button id=&quot;&quot;button4&quot;&quot; class=&quot;&quot;btn btn-danger&quot;&quot;&gt;&lt;span class=&quot;&quot;glyphicon glyphicon-remove&quot;&quot;&gt;&lt;\/span&gt;Close&lt;\/button&gt;&quot; &amp; vbNewLine\r\n \r\n  src = src &amp; &quot;  &lt;\/div&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;&lt;\/body&gt;&quot; &amp; vbNewLine\r\n  src = src &amp; &quot;&lt;\/html&gt;&quot;\r\n  VBA.CallByName d, &quot;write&quot;, VbMethod, src\r\n \r\n  Set btn1 = d.getElementById(&quot;button1&quot;)\r\n  Set btn2 = d.getElementById(&quot;button2&quot;)\r\n  Set btn3 = d.getElementById(&quot;button3&quot;)\r\n  Set btn4 = d.getElementById(&quot;button4&quot;)\r\nEnd Sub\r\n\r\nPrivate Function btn1_onclick() As Boolean\r\n  MsgBox btn1.ID, vbInformation\r\nEnd Function\r\n\r\nPrivate Function btn2_onclick() As Boolean\r\n  MsgBox btn2.ID, vbExclamation\r\nEnd Function\r\n\r\nPrivate Function btn3_onclick() As Boolean\r\n  MsgBox btn3.ID, vbCritical\r\nEnd Function\r\n\r\nPrivate Function btn4_onclick() As Boolean\r\n  Unload Me\r\nEnd Function\r\n\r\nPrivate Sub UserForm_Resize()\r\n'\u30e6\u30fc\u30b6\u30fc\u30d5\u30a9\u30fc\u30e0\u306b\u5408\u308f\u305b\u3066WebBrowser\u30ea\u30b5\u30a4\u30ba\r\n  With Me.WebBrowser1\r\n    .Width = Me.Width\r\n    .Height = Me.Height\r\n  End With\r\nEnd Sub<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/VBA_Bootstrap_01.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/VBA_Bootstrap_01.gif\" alt=\"VBA_Bootstrap_01\" width=\"541\" height=\"356\" class=\"alignnone size-full wp-image-6364\" \/><\/a><\/p>\n<p>\u201c\u5e73\u9762\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u201d\u3068\u3044\u3046\u306e\u306f\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u304c\u3001WebBrowser\u7d4c\u7531\u3067\u3042\u308c\u3070\u300c<a href=\"http:\/\/getbootstrap.com\/\" title=\"Bootstrap \u30fb The world's most popular mobile-first and responsive front-end framework.\" target=\"_blank\">Bootstrap<\/a>\u300d\u7b49\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u304c\u5229\u7528\u3067\u304d\u308b\u306e\u3067\u3001\u65e2\u5b58\u306eActiveX\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u4f7f\u3046\u3088\u308a\u3082\u3001\u30c7\u30b6\u30a4\u30f3\u6027\u306b\u512a\u308c\u305f\u30d5\u30a9\u30fc\u30e0\u306b\u4ed5\u4e0a\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f59\u8a08\u306a\u30c8\u30e9\u30d6\u30eb\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u3082\u3042\u308b\u306e\u3067\u3001\u898b\u305f\u76ee\u306b\u3053\u3060\u308f\u308a\u304c\u7121\u3051\u308c\u3070\u65e2\u5b58\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3067\u5341\u5206\u3060\u3068\u306f\u601d\u3044\u307e\u3059\u304c\u3001\u300c\u3053\u3046\u3044\u3063\u305f\u65b9\u6cd5\u3082\u4e00\u5fdc\u3042\u308b\u3088\u300d\u3068\u3044\u3046\u3053\u3068\u3067\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"MSDN\u30d5\u30a9\u30fc\u30e9\u30e0\u306b\u3042\u3063\u305f\u8cea\u554f\u300cVBA\u3067\u306e\u30d5\u30a9\u30fc\u30e0 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7acb\u4f53\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u304b\u3089\u5e73\u9762\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u306b\u3057\u305f\u3044\u300d\u7528\u306b\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3067\u3059\u3002 \u203b 64\u30d3\u30c3\u30c8\u7248Office\u3067\u5b9f\u884c\u3059\u308b\u5834\u5408\u306f\u8981\u4fee\u6b63 &#8216;UserForm1 &#8216;\u203b We [&hellip;]","protected":false},"author":1,"featured_media":7111,"comment_status":"open","ping_status":"closed","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,48,49,58],"tags":[],"class_list":["post-6363","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-word-office","category-powerpoint"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Excel.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1ED","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6363","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=6363"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6363\/revisions"}],"predecessor-version":[{"id":6366,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6363\/revisions\/6366"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7111"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}