{"id":10001,"date":"2018-02-06T11:00:26","date_gmt":"2018-02-06T02:00:26","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=10001"},"modified":"2018-02-06T11:11:58","modified_gmt":"2018-02-06T02:11:58","slug":"%e5%90%84%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%ae%e5%90%84%e8%a1%8c%e3%81%ae%e8%a1%8c%e9%a0%ad%e3%81%a8%e8%a1%8c%e6%9c%ab%e3%81%ab%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e6%8c%bf%e5%85%a5%e3%81%99%e3%82%8bwo","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=10001","title":{"rendered":"\u5404\u30da\u30fc\u30b8\u306e\u5404\u884c\u306e\u884c\u982d\u3068\u884c\u672b\u306b\u6587\u5b57\u5217\u3092\u633f\u5165\u3059\u308bWord\u30de\u30af\u30ed"},"content":{"rendered":"<p>Word\u6587\u66f8\u306e\u5404\u30da\u30fc\u30b8\u306b10\u884c\u7a0b\u5ea6\u306e\u6587\u7ae0\u304c\u3042\u308a\u3001\u5404\u884c\u306e\u884c\u982d\u3068\u884c\u672b\u306b\u6587\u5b57\u5217\u3092\u633f\u5165\u3059\u308b\u30de\u30af\u30ed\u3092\u4f5c\u308a\u305f\u3044\u3001\u3068\u306e\u8cea\u554f\u3092\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3069\u306e\u3088\u3046\u306a\u6587\u7ae0\u306a\u306e\u304b\u304c\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u6587\u5b57\u901a\u308a\u3010\u5404\u30da\u30fc\u30b8\u306e\u5404\u884c\u3054\u3068\u3011\u3068\u3044\u3046\u3053\u3068\u3067\u3042\u308c\u3070\u3001<a href=\"http:\/\/www.relief.jp\/docs\/word-vba-get-text-each-line.html\" title=\"\u6587\u5b57\u5217\u3092\u4e00\u884c\u305a\u3064\u884c\u5358\u4f4d\u3067\u53d6\u5f97\u3059\u308bWord\u30de\u30af\u30ed:\u30ef\u30fc\u30c9\u30de\u30af\u30ed\u30fbWord VBA\u306e\u4f7f\u3044\u65b9\" target=\"_blank\">\u4f0a\u85e4\u3055\u3093\u306e\u30d6\u30ed\u30b0<\/a>\u3067\u3082\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u300c<a href=\"https:\/\/msdn.microsoft.com\/ja-jp\/vba\/word-vba\/articles\/line-object-word\" title=\"Line \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 (Word)\" target=\"_blank\">Line\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/a>\u300d\u3092\u4f7f\u7528\u3057\u3066\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub Sample01()\r\n'\u5404\u30da\u30fc\u30b8\u306e\u5404\u884c\u306e\u884c\u982d\u3068\u884c\u672b\u306b\u6587\u5b57\u5217\u3092\u633f\u5165\r\n  Dim tmp As Word.WdViewType\r\n  Dim r As Word.Range\r\n  Dim i As Long, j As Long, k As Long\r\n  \r\n  With ActiveDocument.ActiveWindow\r\n    tmp = .View.Type '\u8868\u793a\u72b6\u614b\u3092\u8a18\u61b6\r\n    .View.Type = wdPrintView '\u5370\u5237\u30ec\u30a4\u30a2\u30a6\u30c8\u306b\u5909\u66f4\r\n    \r\n    For i = .ActivePane.Pages.Count To 1 Step -1\r\n      For j = .ActivePane.Pages(i).Rectangles.Count To 1 Step -1\r\n        If .ActivePane.Pages(i).Rectangles(j).RectangleType = wdTextRectangle Then\r\n          For k = .ActivePane.Pages(i).Rectangles(j).Lines.Count To 1 Step -1\r\n            Set r = .ActivePane.Pages(i).Rectangles(j).Lines(k).Range\r\n            Select Case r.Characters(Len(r.Text)).Text\r\n              Case vbCr, vbLf, vbCrLf: r.SetRange r.Start, r.End - 1 '\u6539\u884c\u98db\u3070\u3057\r\n            End Select\r\n            r.InsertAfter &quot;\u3010\u884c\u672b\u3011&quot;\r\n            r.InsertBefore &quot;\u3010\u884c\u982d\u3011&quot;\r\n          Next\r\n        End If\r\n      Next\r\n    Next\r\n    .View.Type = tmp '\u8868\u793a\u72b6\u614b\u3092\u5143\u306b\u623b\u3059\r\n  End With\r\nEnd Sub<\/pre>\n<p>\u3010\u5404\u6bb5\u843d\u3054\u3068\u3011\u3067\u826f\u3044\u306e\u3067\u3042\u308c\u3070\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u300c<a href=\"https:\/\/msdn.microsoft.com\/ja-jp\/vba\/word-vba\/articles\/paragraph-object-word\" title=\"Paragraph \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 (Word)\" target=\"_blank\">Paragraph\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/a>\u300d\u3092\u5229\u7528\u3059\u308c\u3070\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub Sample02()\r\n'\u5404\u6bb5\u843d\u306e\u306f\u3058\u3081\u3068\u7d42\u308f\u308a\u306b\u6587\u5b57\u5217\u3092\u633f\u5165\r\n  Dim r As Word.Range\r\n  Dim i As Long\r\n  \r\n  For i = ActiveDocument.Paragraphs.Count To 1 Step -1\r\n    Set r = ActiveDocument.Paragraphs(i).Range\r\n    Select Case r.Characters(Len(r.Text)).Text\r\n      Case vbCr, vbLf, vbCrLf: r.SetRange r.Start, r.End - 1 '\u6539\u884c\u98db\u3070\u3057\r\n    End Select\r\n    r.InsertAfter &quot;\u3010\u884c\u672b\u3011&quot;\r\n    r.InsertBefore &quot;\u3010\u884c\u982d\u3011&quot;\r\n  Next\r\nEnd Sub<\/pre>\n<p>Word \u30de\u30af\u30ed\u306e\u5834\u5408\u306f\u3001\u3053\u3046\u3044\u3063\u305f\u51e6\u7406\u3092\u69d8\u3005\u306a\u66f8\u304d\u65b9\u3067\u3067\u304d\u308b\u305f\u3081\u3001\u5bfe\u8c61\u3068\u306a\u308b\u6587\u7ae0\u306b\u5fdc\u3058\u3066\u3001\u51e6\u7406\u306e\u4ed5\u65b9\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/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":"Word\u6587\u66f8\u306e\u5404\u30da\u30fc\u30b8\u306b10\u884c\u7a0b\u5ea6\u306e\u6587\u7ae0\u304c\u3042\u308a\u3001\u5404\u884c\u306e\u884c\u982d\u3068\u884c\u672b\u306b\u6587\u5b57\u5217\u3092\u633f\u5165\u3059\u308b\u30de\u30af\u30ed\u3092\u4f5c\u308a\u305f\u3044\u3001\u3068\u306e\u8cea\u554f\u3092\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002 \u3069\u306e\u3088\u3046\u306a\u6587\u7ae0\u306a\u306e\u304b\u304c\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u6587\u5b57\u901a\u308a\u3010\u5404\u30da\u30fc\u30b8\u306e\u5404\u884c\u3054\u3068\u3011\u3068\u3044\u3046\u3053\u3068\u3067\u3042\u308c\u3070\u3001 [&hellip;]","protected":false},"author":1,"featured_media":7136,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Line\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u51e6\u7406\u3059\u308b\u65b9\u6cd5\u3002 [\u5404\u30da\u30fc\u30b8\u306e\u5404\u884c\u306e\u884c\u982d\u3068\u884c\u672b\u306b\u6587\u5b57\u5217\u3092\u633f\u5165\u3059\u308bWord\u30de\u30af\u30ed]","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,49],"tags":[],"class_list":["post-10001","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-word-office"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-WordVBA.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-2Bj","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10001","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=10001"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10001\/revisions"}],"predecessor-version":[{"id":10002,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10001\/revisions\/10002"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7136"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}