{"id":6367,"date":"2015-10-20T09:49:58","date_gmt":"2015-10-20T00:49:58","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=6367"},"modified":"2015-10-20T09:49:58","modified_gmt":"2015-10-20T00:49:58","slug":"vba%e8%87%aa%e5%8b%95%e7%9a%84%e3%81%ab%e3%83%95%e3%82%a9%e3%83%b3%e3%83%88%e3%82%b5%e3%82%a4%e3%82%ba%e3%82%92%e8%aa%bf%e6%95%b4%e3%81%99%e3%82%8b%e7%96%91%e4%bc%bc%e3%83%86%e3%82%ad%e3%82%b9","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=6367","title":{"rendered":"[VBA]\u81ea\u52d5\u7684\u306b\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u3092\u8abf\u6574\u3059\u308b\u7591\u4f3c\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9"},"content":{"rendered":"<p><a href=\"\/\/www.ka-net.org\/blog\/?p=6363\" title=\"[VBA]\u30e6\u30fc\u30b6\u30fc\u30d5\u30a9\u30fc\u30e0\u3067Bootstrap\u3092\u4f7f\u3046\u3002 | \u521d\u5fc3\u8005\u5099\u5fd8\u9332\" target=\"_blank\">\u524d\u56de<\/a>\u3068\u540c\u69d8\u3001\u74b0\u5883\u4f9d\u5b58\u3064\u306a\u304c\u308a\u3067<a href=\"http:\/\/www.moug.net\/faq\/viewtopic.php?t=71306&#038;sid=0e0cf4002b76085b6dc0b9c522a29fa8\" title=\"Excel VBA \u3092\u5b66\u3076\u306a\u3089 moug \u30e2\u30fc\u30b0\uff5c\u307b\u3063\u3068\u3072\u3068\u3044\u304d\u7d66\u6e6f\u5ba4\uff5c\u5922\u306e\u3042\u3068\u306b - moug\u63b2\u793a\u677f\u306e\u8b70\u8ad6\u3067\u8a00\u3044\u6b8b\u3057\u305f\u3053\u3068(3)\" target=\"_blank\">moug\u306e\u7d66\u6e6f\u5ba4<\/a>\u306b\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3092\u8f09\u305b\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">'**************************************************************\r\n'  \u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u307b\u3069\u6587\u5b57\u91cf\u304c\u5897\u3048\u305f\u3089\r\n'  \u81ea\u52d5\u7684\u306b\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u3092\u8abf\u6574\u3059\u308b\u7591\u4f3c\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u30b5\u30f3\u30d7\u30eb\r\n'\r\n'  2015\/9\/9 - @kinuasa\r\n'\r\n'  \u8981\u53c2\u7167\r\n'    Microsoft HTML Object Library\r\n'  \u8981\u914d\u7f6e\r\n'    WebBrowser\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb(WebBrowser1)(\u5fc5\u9808),\r\n'    CommandButton\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb(CommandButton1)(\u78ba\u8a8d\u7528\u306a\u306e\u3067\u5fc5\u9808\u3067\u306f\u306a\u3044)\r\n'**************************************************************\r\n\r\nOption Explicit\r\n\r\nPrivate WithEvents HTMLTextArea As MSHTML.HTMLTextAreaElement\r\nPrivate TextAreaFontSize As Long\r\nPrivate Const DefaultStyle As String = &quot;width:100%;height:100%;border:none;overflow:auto;font-family:'MS UI Gothic';&quot; '\u30b9\u30bf\u30a4\u30eb\u306f\u597d\u307f\u306b\u5fdc\u3058\u3066\u5909\u66f4\r\n\r\nPrivate Sub UserForm_Initialize()\r\n  TextAreaFontSize = 20 '\u521d\u671f\u5024\r\n  With Me.WebBrowser1\r\n    .AddressBar = False\r\n    .MenuBar = False\r\n    .StatusBar = False\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    With .Document\r\n      .body.Scroll = &quot;no&quot;\r\n      .body.Style.cssText = &quot;margin:0;padding:0;&quot;\r\n      Set HTMLTextArea = .createElement(&quot;textarea&quot;)\r\n      HTMLTextArea.Style.cssText = DefaultStyle &amp; &quot;font-size:&quot; &amp; TextAreaFontSize &amp; &quot;pt;&quot;\r\n      .body.appendChild HTMLTextArea\r\n    End With\r\n  End With\r\nEnd Sub\r\n\r\nPrivate Sub HTMLTextArea_onkeydown()\r\n  If TextAreaFontSize &gt; 10 Then '\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u306e\u6700\u5c0f\u5024\u6307\u5b9a\r\n    With HTMLTextArea\r\n      If HTMLTextArea.offsetHeight &lt; HTMLTextArea.ScrollHeight Then\r\n        TextAreaFontSize = TextAreaFontSize - 2\r\n        .Style.cssText = DefaultStyle &amp; &quot;font-size:&quot; &amp; TextAreaFontSize &amp; &quot;pt;&quot;\r\n      End If\r\n    End With\r\n  End If\r\nEnd Sub\r\n\r\nPrivate Sub CommandButton1_Click()\r\n  With HTMLTextArea\r\n    MsgBox .Value, vbInformation + vbSystemModal '\u78ba\u8a8d\u7528\r\n    .Value = &quot;&quot;\r\n    TextAreaFontSize = 20\r\n    .Style.cssText = DefaultStyle &amp; &quot;font-size:&quot; &amp; TextAreaFontSize &amp; &quot;pt;&quot;\r\n  End With\r\nEnd Sub<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/HTMLTextAreaInput_01.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/HTMLTextAreaInput_01.gif\" alt=\"HTMLTextAreaInput_01\" width=\"517\" height=\"273\" class=\"alignnone size-full wp-image-6368\" \/><\/a><\/p>\n<p>\u52d5\u304d\u3068\u3057\u3066\u306f\u9762\u767d\u3044\u306e\u3067\u3059\u304c\u3001\u5b9f\u969b\u306e\u696d\u52d9\u3067\u4f7f\u3046\u306e\u306f\u3042\u307e\u308a\u30aa\u30b9\u30b9\u30e1\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u300c\u3053\u3046\u3044\u3046\u3053\u3068\u3082\u3067\u304d\u308b\u3093\u3060\uff01\u300d\u3068\u3001\u697d\u3057\u3080\u304f\u3089\u3044\u304c\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u524d\u56de\u3068\u540c\u69d8\u3001\u74b0\u5883\u4f9d\u5b58\u3064\u306a\u304c\u308a\u3067moug\u306e\u7d66\u6e6f\u5ba4\u306b\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3092\u8f09\u305b\u3066\u304a\u304d\u307e\u3059\u3002 &#8216;************************************************************** &#8216; \u30b9\u30af\u30ed\u30fc [&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-6367","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-1EH","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6367","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=6367"}],"version-history":[{"count":4,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6367\/revisions"}],"predecessor-version":[{"id":6372,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6367\/revisions\/6372"}],"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=6367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}