{"id":181,"date":"2024-11-01T21:34:31","date_gmt":"2024-11-01T12:34:31","guid":{"rendered":"https:\/\/anbtksh.com\/?p=181"},"modified":"2024-11-07T20:15:59","modified_gmt":"2024-11-07T11:15:59","slug":"181","status":"publish","type":"post","link":"https:\/\/anbtksh.com\/?p=181","title":{"rendered":"\u30b7\u30a7\u30a4\u30d7\u5185\u306e\u30c6\u30ad\u30b9\u30c8\u306e\uff12\u884c\u76ee\u3060\u3051\u30d5\u30a9\u30f3\u30c8\u3092\u5909\u66f4"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">2024.11.1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">vbCrLf \u3067\u306f\u306a\u304f\u3001vbLf \u3067\u3046\u307e\u304f\u3044\u3063\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sub \u4e8c\u884c\u76ee\u3092Meiryo_UI\u306b\u3067\u304d\u305f()<br>Dim shape As shape<br>Dim textBoxText As String<br>Dim lines As Variant<br>Dim secondLineStart As Long<br>Dim secondLineLength As Longc<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>For Each shape In ActiveSheet.Shapes\n    If shape.TextFrame2.HasText Then\n        textBoxText = shape.TextFrame2.TextRange.Text\n        lines = Split(textBoxText, vbLf)\n\n        If UBound(lines) &gt;= 1 Then ' 2\u884c\u76ee\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\n            secondLineStart = Len(lines(0)) + 2 ' 1\u884c\u76ee\u306e\u9577\u3055 + \u6539\u884c2\u6587\u5b57\n\n            If Len(lines(1)) &gt; 0 Then\n                secondLineLength = Len(lines(1))\n                With shape.TextFrame2.TextRange.Characters(secondLineStart, secondLineLength).Font\n                    .Name = \"Meiryo UI\"\n                    .NameFarEast = \"Meiryo UI\"\n                    .NameComplexScript = \"Meiryo UI\"\n                    .Size = 13\n                End With\n            End If\n        End If\n    End If\nNext shape<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">End Sub<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sub \u30c6\u30ad\u30b9\u30c8\u304c\u5168\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u30b7\u30a7\u30a4\u30d7\u306e2\u884c\u76ee\u3092Meiryo_8point()<br>Dim shape As shape<br>Dim textFrame As TextFrame2<br>Dim textRange As TextRange2<br>Dim textBoxText As String<br>Dim lines As Variant<br>Dim secondLineStart As Long<br>Dim secondLineLength As Long<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>For Each shape In ActiveSheet.Shapes\n    If shape.TextFrame2.HasText Then\n        Set textFrame = shape.TextFrame2\n        Set textRange = textFrame.textRange\n\n        ' \u30c6\u30ad\u30b9\u30c8\u306e\u9ad8\u3055\u3092\u30c1\u30a7\u30c3\u30af\n        If textRange.BoundHeight &gt; shape.Height Then\n            Debug.Print \"\u30c6\u30ad\u30b9\u30c8\u304c\u3059\u3079\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u30b7\u30a7\u30a4\u30d7: \" &amp; shape.Name\n\n            ' \u30c6\u30ad\u30b9\u30c8\u304c\u3059\u3079\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u30b7\u30a7\u30a4\u30d7\u306e2\u884c\u76ee\u3092\u66f4\u65b0\n            textBoxText = textRange.Text\n            lines = Split(textBoxText, vbLf)\n\n            If UBound(lines) &gt;= 1 Then ' 2\u884c\u76ee\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\n                secondLineStart = Len(lines(0)) + 2 ' 1\u884c\u76ee\u306e\u9577\u3055 + \u6539\u884c2\u6587\u5b57\n\n                If Len(lines(1)) &gt; 0 Then\n                    secondLineLength = Len(lines(1))\n                    With textRange.Characters(secondLineStart, secondLineLength).Font\n                        .Name = \"Meiryo UI\"\n                        .NameFarEast = \"Meiryo UI\"\n                        .NameComplexScript = \"Meiryo UI\"\n                        .Size = 8\n                    End With\n                End If\n            End If\n        End If\n    End If\nNext shape<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">End Sub<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53f3\u30af\u30ea\u30c3\u30af\u3092\u6614\u98a8\u306b reg.exe add &#8220;HKCU\\Software\\Classes\\CLSID\\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\\InprocServer32&#8221; \/f \/ve <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53f3\u30af\u30ea\u30c3\u30af\u3092\u6a19\u6e96\u8a2d\u5b9a\u306b\u623b\u3059 reg.exe delete &#8220;HKCU\\Software\\Classes\\CLSID\\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}&#8221; \/f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2024.11.1 vbCrLf \u3067\u306f\u306a\u304f\u3001vbLf \u3067\u3046\u307e\u304f\u3044\u3063\u305f\u3002 Sub \u4e8c\u884c\u76ee\u3092Meiryo_UI\u306b\u3067\u304d\u305f()Dim shape As shapeDim textBoxText As StringDim line &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/anbtksh.com\/?p=181\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u30b7\u30a7\u30a4\u30d7\u5185\u306e\u30c6\u30ad\u30b9\u30c8\u306e\uff12\u884c\u76ee\u3060\u3051\u30d5\u30a9\u30f3\u30c8\u3092\u5909\u66f4&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/anbtksh.com\/index.php?rest_route=\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anbtksh.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anbtksh.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anbtksh.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anbtksh.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":4,"href":"https:\/\/anbtksh.com\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":185,"href":"https:\/\/anbtksh.com\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/185"}],"wp:attachment":[{"href":"https:\/\/anbtksh.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anbtksh.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anbtksh.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}