{"id":6179,"date":"2015-09-02T15:39:45","date_gmt":"2015-09-02T06:39:45","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=6179"},"modified":"2015-09-02T15:39:45","modified_gmt":"2015-09-02T06:39:45","slug":"%e3%82%bb%e3%83%ab%e5%86%85%e3%81%ab%e3%81%82%e3%82%8b%e3%83%96%e3%83%83%e3%82%af%e3%83%9e%e3%83%bc%e3%82%af%e3%82%92%e3%82%ab%e3%82%a6%e3%83%b3%e3%83%88%e3%81%99%e3%82%8bword%e3%83%9e%e3%82%af","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=6179","title":{"rendered":"\u30bb\u30eb\u5185\u306b\u3042\u308b\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308bWord\u30de\u30af\u30ed"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/\" title=\"Twitter\" target=\"_blank\">Twitter<\/a>\u3092\u773a\u3081\u3066\u3044\u305f\u3089\u4e0b\u8a18\u30c4\u30a4\u30fc\u30c8\u3092\u767a\u898b\u3057\u307e\u3057\u305f\u3002<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"ja\">\n<p lang=\"ja\" dir=\"ltr\">\u3010Word\u3011\u8868\u4e2d\u306e\u7279\u5b9a\u30bb\u30eb\u306b\u30d6\u30c3\u30af\u30de\u30fc\u30af\u304c\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\u8abf\u3079\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u305f\u3044\u3051\u308c\u3069\u3001\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u306a\u3042\u3001doc.Tables(1).Cell(\u30bb\u30eb\u884c, \u30bb\u30eb\u5217)\u306e\u7bc4\u56f2\u3067\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u3068\u3001\u8a72\u5f53\u30bb\u30eb\u3068\u540c\u3058\u884c\u306b\u542b\u307e\u308c\u308b\u30d6\u30c3\u30af\u30de\u30fc\u30af\u304c\u3059\u3079\u3066\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u308b\u3002\u3042\u308c\u308c\uff5e\u3002<\/p>\n<p>&mdash; \u304d\u304c\u3088\uff10\uff18\uff13 (@kigayo083) <a href=\"https:\/\/twitter.com\/kigayo083\/status\/638575544230014977\">2015, 9\u6708 1<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>Word\u306e\u8868\u4e2d\u306b\u3042\u308b\u30bb\u30eb\u306b\u542b\u307e\u308c\u308b\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u3068\u3001\u305d\u306e\u30bb\u30eb\u3068\u540c\u3058\u884c\u306b\u3042\u308b\u4ed6\u306e\u30d6\u30c3\u30af\u30de\u30fc\u30af\u307e\u3067\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u308b\u3068\u3044\u3046\u306e\u3067\u3059\u3002<\/p>\n<p>\u3055\u3063\u305d\u304f\u78ba\u304b\u3081\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305a\u306f\u4e0b\u56f3\u306e\u3088\u3046\u306a\u30c6\u30b9\u30c8\u7528\u306e\u8868\u3092\u7528\u610f\u3057\u307e\u3059\u3002<br \/>\n\u8868\u4e2d\u306e\u30bb\u30eb\u306b\u306f\u30d6\u30c3\u30af\u30de\u30fc\u30af\u304c\u8a2d\u5b9a\u3057\u3066\u3042\u308a\u3001\u5206\u304b\u308a\u3084\u3059\u3044\u3088\u3046\u306b\u86cd\u5149\u30da\u30f3\u3067\u30de\u30fc\u30af\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_01.jpg\" alt=\"WordVBA_CountBookmarks_01\" width=\"648\" height=\"333\" class=\"alignnone size-full wp-image-6180\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_01.jpg 648w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_01-300x154.jpg 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>\u3053\u306e\u8868\u306b\u5bfe\u3057\u3066\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u3001<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub Test()\r\n  Dim bm As Word.Bookmark\r\n  \r\n  With ActiveDocument.Tables(1).Cell(1, 1).Range\r\n    Debug.Print &quot;Bookmarks:&quot; &amp; .Bookmarks.Count\r\n    For Each bm In .Bookmarks\r\n      Debug.Print bm.Range.Text\r\n    Next\r\n  End With\r\nEnd Sub<\/pre>\n<p>\u672c\u6765\u3067\u3042\u308c\u3070\u4e0b\u56f3\u306e\u3088\u3046\u306b\u306a\u308b\u306f\u305a\u304c\u3001<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_02.jpg\" alt=\"WordVBA_CountBookmarks_02\" width=\"174\" height=\"128\" class=\"alignnone size-full wp-image-6181\" \/><\/a><\/p>\n<p>\u4e0b\u56f3\u306e\u7d50\u679c\u3068\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_03.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_03.jpg\" alt=\"WordVBA_CountBookmarks_03\" width=\"174\" height=\"128\" class=\"alignnone size-full wp-image-6182\" \/><\/a><\/p>\n<p>\u3053\u308c\u3092\u898b\u308b\u3068\u3001\u305f\u3057\u304b\u306b\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u304c\u3042\u308b\u884c\u306b\u542b\u307e\u308c\u308b\u30d6\u30c3\u30af\u30de\u30fc\u30af\u304c\u3059\u3079\u3066\u53d6\u5f97\u3055\u308c\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3084\u308a\u65b9\u3092\u5909\u3048\u3066\u3001\u4e0b\u56f3\u306e\u3088\u3046\u306b\u7279\u5b9a\u306e\u30bb\u30eb\u306e\u307f\u3092\u9078\u629e\u3057\u3066\u3001Selection\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u30d6\u30c3\u30af\u30de\u30fc\u30af\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u7d50\u679c\u306f\u540c\u3058\u3067\u3057\u305f\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_04.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_04.jpg\" alt=\"WordVBA_CountBookmarks_04\" width=\"412\" height=\"217\" class=\"alignnone size-full wp-image-6183\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_04.jpg 412w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_04-300x158.jpg 300w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/a><\/p>\n<p>\u30fb\u30fb\u30fb\u539f\u56e0\u306f\u6c17\u306b\u306a\u308b\u3068\u3053\u308d\u3067\u3059\u304c\u3001Word\u3067\u30de\u30af\u30ed\u3092\u6271\u3063\u3066\u3044\u308b\u3068\u3001\u3053\u3046\u3057\u305f\u610f\u56f3\u3057\u306a\u3044\u7d50\u679c\u306b\u306a\u308b\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u306e\u3067\u3001\u3042\u307e\u308a\u6df1\u8ffd\u3044\u3057\u306a\u3044\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u5bfe\u5fdc\u3068\u3057\u3066\u306f\u3001\u5358\u7d14\u306b<span style=\"color: #ff0000; font-weight: bold;\">\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306e\u958b\u59cb\u4f4d\u7f6e\u3068\u7d42\u4e86\u4f4d\u7f6e\u304c\u3001\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u5185\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u8abf\u3079\u308c\u3070\u826f\u3044<\/span>\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub Test2()\r\n  Debug.Print &quot;Bookmarks:&quot; &amp; _\r\n              CountBookmarks(ActiveDocument.Tables(1).Cell(1, 1))\r\nEnd Sub\r\n\r\nPublic Function CountBookmarks(ByVal TargetCell As Word.Cell) As Long\r\n  Dim bm As Word.Bookmark\r\n  Dim cnt As Long\r\n  \r\n  cnt = 0 '\u521d\u671f\u5316\r\n  With TargetCell.Range\r\n    For Each bm In ActiveDocument.Bookmarks\r\n      If bm.Start &gt;= .Start And _\r\n         bm.End &lt;= .End Then\r\n        cnt = cnt + 1\r\n      End If\r\n    Next\r\n  End With\r\n  CountBookmarks = cnt\r\nEnd Function<\/pre>\n<p>\u3053\u308c\u3067\u3088\u3046\u3084\u304f\u610f\u56f3\u3057\u305f\u901a\u308a\u306e\u7d50\u679c\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_05.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/WordVBA_CountBookmarks_05.jpg\" alt=\"WordVBA_CountBookmarks_05\" width=\"168\" height=\"83\" class=\"alignnone size-full wp-image-6184\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Twitter\u3092\u773a\u3081\u3066\u3044\u305f\u3089\u4e0b\u8a18\u30c4\u30a4\u30fc\u30c8\u3092\u767a\u898b\u3057\u307e\u3057\u305f\u3002 \u3010Word\u3011\u8868\u4e2d\u306e\u7279\u5b9a\u30bb\u30eb\u306b\u30d6\u30c3\u30af\u30de\u30fc\u30af\u304c\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\u8abf\u3079\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u305f\u3044\u3051\u308c\u3069\u3001\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u306a\u3042\u3001doc.Tables(1).Cell(\u30bb\u30eb\u884c, \u30bb\u30eb\u5217 [&hellip;]","protected":false},"author":1,"featured_media":7134,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Woed VBA\u3067\u610f\u56f3\u3057\u306a\u3044\u7d50\u679c\u306b\u306a\u308b\u306e\u306f\u6c17\u306b\u3057\u306a\u3044\u3053\u3068\u306b\u3057\u3066\u3044\u307e\u3059\u3002 [\u30bb\u30eb\u5185\u306b\u3042\u308b\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u30ab\u30a6\u30f3\u30c8\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-6179","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-Word.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1BF","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6179","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=6179"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6179\/revisions"}],"predecessor-version":[{"id":6186,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6179\/revisions\/6186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7134"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}