{"id":7065,"date":"2016-06-28T16:05:50","date_gmt":"2016-06-28T07:05:50","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=7065"},"modified":"2016-06-28T16:05:50","modified_gmt":"2016-06-28T07:05:50","slug":"acrobat%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6pdf%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92n%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8bvba%e3%83%9e%e3%82%af%e3%83%ad","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=7065","title":{"rendered":"Acrobat\u3092\u4f7f\u3063\u3066PDF\u30d5\u30a1\u30a4\u30eb\u3092N\u30a2\u30c3\u30d7\u3059\u308bVBA\u30de\u30af\u30ed"},"content":{"rendered":"<p><em>VBA\u3067\u3001B5\u30b5\u30a4\u30ba\u306ePDF\u30d5\u30a1\u30a4\u30eb\u3092\u6a2a\u4e26\u3073\u306b\u3057\u3066B4\u30b5\u30a4\u30ba\u306ePDF\u30d5\u30a1\u30a4\u30eb\u306b\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u304b\uff1f<\/em>\u3068\u3044\u3046\u8cea\u554f\u3092\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u624b\u306e\u51e6\u7406\u306f\u3088\u304f\u3042\u308b\u3053\u3068\u3067\u3001\u624b\u4f5c\u696d\u3067\u884c\u3046\u5834\u5408\u306f\u4e0b\u8a18\u30da\u30fc\u30b8\u306e\u3088\u3046\u306a\u51e6\u7406\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>\u30fb\u3010\u89e3\u6c7a\u4e8b\u4f8b\u3011Acrobat XI Pro\u300c\u7e26\u5411\u304d\u306eA4\u30b5\u30a4\u30ba\u306ePDF\u306e\u5404\u30da\u30fc\u30b8\u3092\u6a2a\u306b\u4e26\u3079\u3066\u7d50\u5408\u3057\u3001A3\u30b5\u30a4\u30ba\u3067\u30d7\u30ea\u30f3\u30c8\u3057\u305f\u3044\u300d<\/strong><br \/>\n<a href=\"https:\/\/forums.adobe.com\/thread\/1615335\" title=\"\u3010\u89e3\u6c7a\u4e8b\u4f8b\u3011Acrobat XI Pro\u300c\u7e26\u5411\u304d\u306eA4\u30b5\u30a4\u30ba\u306ePDF\u306e\u5404\u30da\u30fc\u30b8\u3092\u6a2a\u306b\u4e26\u3079\u3066\u7d50\u5408\u3057\u3001A3\u30b5\u30a4\u30ba\u3067\u30d7\u30ea\u30f3\u30c8\u3057\u305f\u3044\u300d\" target=\"_blank\">https:\/\/forums.adobe.com\/thread\/1615335<\/a><\/p>\n<p>\u3044\u308f\u3086\u308b<a href=\"https:\/\/www.fujixerox.co.jp\/support\/mf\/mf_common\/answer\/134_058.html\" title=\"\u307e\u3068\u3081\u30661\u679a\uff08\uff2e\u30a2\u30c3\u30d7\uff09\u3068\u306f\u4f55\u3067\u3059\u304b\u3001\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002\" target=\"_blank\">N\u30a2\u30c3\u30d7\u5370\u5237<\/a>\u3067\u3059\u306d\u3002<\/p>\n<p>VBA(Acrobat\u30aa\u30fc\u30c8\u30e1\u30fc\u30b7\u30e7\u30f3\u3001Acrobat JavaScript)\u304b\u3089\u3067\u3082\u3082\u3061\u308d\u3093\u51e6\u7406\u3067\u304d\u307e\u3059\u304c\u3001\u4e8b\u524d\u51e6\u7406\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n(\u4e0b\u8a18\u4e8b\u524d\u51e6\u7406\u306e\u81ea\u52d5\u5316\u3082\u3067\u304d\u306a\u3044\u3053\u3068\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u9762\u5012\u306a\u306e\u3067\u5272\u611b\u3057\u307e\u3059\u3002)<\/p>\n<h4 class=\"style4a\">\u4e8b\u524d\u51e6\u7406<\/h4>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b \u4e0b\u8a18\u8a2d\u5b9a\u306f\u7e26\u5411\u304d\u306eB5\u30b5\u30a4\u30ba\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6a2a\u306b\u4e26\u3079\u3066B4\u30b5\u30a4\u30ba\u3067\u51fa\u529b\u3059\u308b\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8a2d\u5b9a\u5185\u5bb9\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<ol>\n<li>\u300cAdobe PDF\u300d\u30d7\u30ea\u30f3\u30bf\u30fc\u306e\u30d7\u30ed\u30d1\u30c6\u30a3(\u57fa\u672c\u8a2d\u5b9a)\u3092\u958b\u304d\u307e\u3059\u3002<\/li>\n<li>\u300cAdobe PDF \u8a2d\u5b9a\u300d\u30bf\u30d6\u306e\u5404\u9805\u76ee\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<p>\u30fbAdobe PDF \u4fdd\u5b58\u5148\u30d5\u30a9\u30eb\u30c0\u30fc(F)\uff1aC:\\Test\\PDF<br \/>\n\u30fbAdobe PDF \u306e\u30da\u30fc\u30b8\u30b5\u30a4\u30ba(Z)\uff1aB4<br \/>\n\u30fb\u7d50\u679c\u306e Adobe PDF \u3092\u8868\u793a(V)\uff1a\u30aa\u30d5<br \/>\n\u30fb\u65e2\u5b58\u306e PDF \u30d5\u30a1\u30a4\u30eb\u306e\u4e0a\u66f8\u304d\u3092\u78ba\u8a8d(R)\uff1a\u30aa\u30d5<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_01.jpg\" alt=\"Acrobat_NUp_01\" width=\"598\" height=\"550\" class=\"alignnone size-full wp-image-7066\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_01.jpg 598w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_01-300x276.jpg 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/p>\n<li>\u300c\u30ec\u30a4\u30a2\u30a6\u30c8\u300d\u30bf\u30d6\u304b\u3089\u300c\u5370\u5237\u306e\u5411\u304d(O)\u300d\u3092\u300c<span style=\"color: #ff0000; font-weight: bold;\">\u6a2a<\/span>\u300d\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_02.jpg\" alt=\"Acrobat_NUp_02\" width=\"598\" height=\"550\" class=\"alignnone size-full wp-image-7067\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_02.jpg 598w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_02-300x276.jpg 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/p>\n<li>\u300cOK\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u8a2d\u5b9a\u3092\u53cd\u6620\u3001\u753b\u9762\u3092\u9589\u3058\u307e\u3059\u3002<\/li>\n<\/ol>\n<h4 class=\"style4a\">VBA\u30b3\u30fc\u30c9<\/h4>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b \u4e0b\u8a18\u30b3\u30fc\u30c9\u306f\u300cC:\\Test\\B5x2.pdf\u300d\u30d5\u30a1\u30a4\u30eb\u3092\u300cC:\\Test\\PDF\u300d\u30d5\u30a9\u30eb\u30c0\u30fc\u306b\u51fa\u529b\u3059\u308b\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub Sample()\r\n'\u8981&#x5B;Adobe PDF]\u30d7\u30ea\u30f3\u30bf\u30fc\u306e\u4e8b\u524d\u8a2d\u5b9a\r\n  Const SrcFilePath As String = &quot;C:\\Test\\&quot; '\u5143\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\u30d1\u30b9\r\n  Const DestFilePath As String = &quot;C:\\Test\\PDF\\&quot; 'Adobe PDF \u4fdd\u5b58\u5148\u30d5\u30a9\u30eb\u30c0\u30fc\r\n  Const PdfFileName As String = &quot;B5x2.pdf&quot; '\u5143\u30d5\u30a1\u30a4\u30eb\u540d\r\n  \r\n  NUpPdf SrcFilePath &amp; PdfFileName, 2, 1\r\n  If MsgBox(&quot;N-up\u5370\u5237\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002&quot; &amp; vbNewLine &amp; _\r\n            &quot;\u30da\u30fc\u30b8\u56de\u8ee2\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u304b\uff1f&quot;, vbYesNo) = vbYes Then\r\n    RotatePdfPage DestFilePath &amp; PdfFileName, 90\r\n  End If\r\n  MsgBox &quot;\u51e6\u7406\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002&quot;, vbInformation + vbSystemModal\r\nEnd Sub\r\n\r\nPrivate Sub NUpPdf(ByVal PdfFilePath As String, _\r\n                   ByVal NumPagesH As Integer, _\r\n                   ByVal NumPagesV As Integer)\r\n'1\u679a\u3042\u305f\u308a\u306e\u30da\u30fc\u30b8\u6570\u3092\u6307\u5b9a\u3057\u3066\u518dPDF\u5316\r\n'(&#x5B;Adobe PDF]\u30d7\u30ea\u30f3\u30bf\u30fc\u3067\u5370\u5237\u51e6\u7406)\r\n  Dim app As Object\r\n  Dim avdoc As Object\r\n  Dim jso As Object\r\n  Dim pp As Object\r\n  \r\n  Set app = CreateObject(&quot;AcroExch.App&quot;)\r\n  Set avdoc = CreateObject(&quot;AcroExch.AVDoc&quot;)\r\n  If avdoc.Open(PdfFilePath, &quot;&quot;) = True Then\r\n    app.Show 'Acrobat\u8868\u793a\r\n    Set jso = avdoc.GetPDDoc.GetJSObject\r\n    Set pp = jso.getPrintParams\r\n    CallByName pp, &quot;printerName&quot;, VbSet, &quot;Adobe PDF&quot; '\u30d7\u30ea\u30f3\u30bf\u30fc\u6307\u5b9a\r\n    CallByName pp, &quot;firstPage&quot;, VbSet, 0 '\u5370\u5237\u3059\u308b\u30da\u30fc\u30b8:\u3059\u3079\u3066\r\n    CallByName pp, &quot;lastPage&quot;, VbSet, avdoc.GetPDDoc.GetNumPages - 1\r\n    CallByName pp, &quot;pageHandling&quot;, VbSet, 6 'constants.handling.nUp\r\n    CallByName pp, &quot;nUpAutoRotate&quot;, VbSet, True '\u5404\u30b7\u30fc\u30c8\u5185\u3067\u30da\u30fc\u30b8\u3092\u81ea\u52d5\u56de\u8ee2\r\n    CallByName pp, &quot;nUpNumPagesH&quot;, VbSet, NumPagesH '1\u679a\u3042\u305f\u308a\u306e\u30da\u30fc\u30b8\u6570(\u6a2a)\r\n    CallByName pp, &quot;nUpNumPagesV&quot;, VbSet, NumPagesV '1\u679a\u3042\u305f\u308a\u306e\u30da\u30fc\u30b8\u6570(\u7e26)\r\n    CallByName pp, &quot;nUpPageOrder&quot;, VbSet, 0 'constants.nUpPageOrders.Horizontal:\u30da\u30fc\u30b8\u306e\u9806\u5e8f(\u6a2a)\r\n    CallByName pp, &quot;nUpPageBorder&quot;, VbSet, False '\u30da\u30fc\u30b8\u5883\u754c\u7dda\u3092\u5370\u5237(\u3057\u306a\u3044)\r\n    CallByName pp, &quot;interactive&quot;, VbSet, 2 'constants.interactionLevel.silent\r\n    CallByName jso, &quot;print&quot;, VbMethod, pp\r\n    avdoc.Close 1 '\u6587\u66f8\u3092\u4fdd\u5b58\u305b\u305a\u306b\u9589\u3058\u308b\r\n    app.Hide: app.Exit\r\n  End If\r\nEnd Sub\r\n\r\nPrivate Sub RotatePdfPage(ByVal PdfFilePath As String, _\r\n                          ByVal PageRotate As Integer)\r\n'\u6307\u5b9a\u3057\u305fPDF\u30d5\u30a1\u30a4\u30eb\u3092\u56de\u8ee2\r\n  Dim app As Object\r\n  Dim avdoc As Object\r\n  Dim avpv As Object\r\n  Dim i As Long\r\n  Const PDSaveFull = 1\r\n  \r\n  Set app = CreateObject(&quot;AcroExch.App&quot;)\r\n  Set avdoc = CreateObject(&quot;AcroExch.AVDoc&quot;)\r\n  app.Show 'Acrobat\u8868\u793a\r\n  If avdoc.Open(PdfFilePath, &quot;&quot;) = True Then\r\n    Set avpv = avdoc.GetAVPageView 'AcroAVPageView\r\n    For i = 0 To avdoc.GetPDDoc.GetNumPages - 1\r\n      CallByName avpv, &quot;GoTo&quot;, VbMethod, i '\u30da\u30fc\u30b8\u79fb\u52d5\r\n      avpv.GetPage.SetRotate PageRotate\r\n    Next\r\n    avdoc.GetPDDoc.Save PDSaveFull, PdfFilePath '\u4e0a\u66f8\u304d\u4fdd\u5b58\r\n    avdoc.Close 1 '\u6587\u66f8\u3092\u4fdd\u5b58\u305b\u305a\u306b\u9589\u3058\u308b\r\n    app.Hide: app.Exit\r\n  End If\r\nEnd Sub<\/pre>\n<p>JSObject\u7d4c\u7531\u3067getPrintParams\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u3067\u3001PDF\u30d5\u30a1\u30a4\u30eb\u3092\u5370\u5237\u3059\u308b\u30d7\u30ea\u30f3\u30bf\u30fc(Adobe PDF)\u30841\u679a\u3042\u305f\u308a\u306e\u30da\u30fc\u30b8\u6570\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u51fa\u529b\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u7528\u7d19\u304c\u7e26\u5411\u304d\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001RotatePdfPage\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u30fc\u3067\u30da\u30fc\u30b8\u306e\u56de\u8ee2\u3092\u884c\u3044\u3001\u6b63\u3057\u3044\u5411\u304d\u306b\u4fee\u6b63\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4 class=\"style4a\">\u5b9f\u884c\u7d50\u679c<\/h4>\n<p>\u7d50\u679c\u306f\u4e0b\u56f3\u306e\u901a\u308a\u3067\u3001\u610f\u56f3\u3057\u305f\u901a\u308a\u7e26\u5411\u304d\u306ePDF\u30d5\u30a1\u30a4\u30eb(B5)\u304c\u6a2a\u5411\u304d\u306ePDF\u30d5\u30a1\u30a4\u30eb(B4)\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_03.jpg\" alt=\"Acrobat_NUp_03\" width=\"885\" height=\"1246\" class=\"alignnone size-full wp-image-7068\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_03.jpg 885w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_03-213x300.jpg 213w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_03-768x1081.jpg 768w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Acrobat_NUp_03-727x1024.jpg 727w\" sizes=\"auto, (max-width: 885px) 100vw, 885px\" \/><\/p>\n<p>\u4e8b\u524d\u306b\u30d7\u30ea\u30f3\u30bf\u30fc\u8a2d\u5b9a\u3092\u884c\u3046\u624b\u9593\u304c\u639b\u304b\u308a\u307e\u3059\u304c\u3001PDF\u30d5\u30a1\u30a4\u30eb\u306eN\u30a2\u30c3\u30d7\u51e6\u7406\u306e\u81ea\u52d5\u5316\u3092\u8003\u3048\u3066\u3044\u308b\u65b9\u306f\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"VBA\u3067\u3001B5\u30b5\u30a4\u30ba\u306ePDF\u30d5\u30a1\u30a4\u30eb\u3092\u6a2a\u4e26\u3073\u306b\u3057\u3066B4\u30b5\u30a4\u30ba\u306ePDF\u30d5\u30a1\u30a4\u30eb\u306b\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u304b\uff1f\u3068\u3044\u3046\u8cea\u554f\u3092\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002 \u3053\u306e\u624b\u306e\u51e6\u7406\u306f\u3088\u304f\u3042\u308b\u3053\u3068\u3067\u3001\u624b\u4f5c\u696d\u3067\u884c\u3046\u5834\u5408\u306f\u4e0b\u8a18\u30da\u30fc\u30b8\u306e\u3088\u3046\u306a\u51e6\u7406\u306b\u306a\u308a\u307e\u3059\u3002 \u30fb [&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":"[Acrobat\u3092\u4f7f\u3063\u3066PDF\u30d5\u30a1\u30a4\u30eb\u3092N\u30a2\u30c3\u30d7\u3059\u308bVBA\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,48,49,136],"tags":[],"class_list":["post-7065","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-word-office","category-acrobat"],"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-1PX","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7065","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=7065"}],"version-history":[{"count":3,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7065\/revisions"}],"predecessor-version":[{"id":7071,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7065\/revisions\/7071"}],"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=7065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}