{"id":1740,"date":"2012-05-31T17:32:59","date_gmt":"2012-05-31T08:32:59","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=1740"},"modified":"2014-02-13T10:56:03","modified_gmt":"2014-02-13T01:56:03","slug":"espcenet%e3%81%8c%e5%85%ac%e9%96%8b%e3%81%97%e3%81%a6%e3%81%84%e3%82%8bpdf%e5%85%ac%e5%a0%b1%e3%82%92%e3%83%80%e3%82%a6%e3%83%b3%e3%83%ad%e3%83%bc%e3%83%89%e3%81%99%e3%82%8bvba%e3%83%9e%e3%82%af","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=1740","title":{"rendered":"esp@cenet\u304c\u516c\u958b\u3057\u3066\u3044\u308bPDF\u516c\u5831\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308bVBA\u30de\u30af\u30ed"},"content":{"rendered":"<p><a href=\"http:\/\/worldwide.espacenet.com\/?locale=jp_EP\" title=\"Espacenet\" target=\"_blank\">esp@cenet(Espacenet)<\/a>\u304c\u516c\u958b\u3057\u3066\u3044\u308bRESTful\u306a<a href=\"http:\/\/www.epo.org\/searching\/free\/ops.html\" title=\"Open Patent Services (OPS)\" target=\"_blank\">Web API<\/a>\u3092\u5229\u7528\u3057\u3066\u3001PDF\u516c\u5831\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u30de\u30af\u30ed\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u5f15\u6570\u3068\u3057\u3066\u516c\u958b\u756a\u53f7\u3068PDF\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u5148\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9\u3092\u6e21\u3059\u3068\u3001\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u306b\u516c\u958b\u756a\u53f7\u540d\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u4e2d\u306bPDF\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30fb\u4fdd\u5b58\u3059\u308b\u30de\u30af\u30ed\u3067\u3059\u3002<br \/>\n(\u51e6\u7406\u7d42\u4e86\u5f8c\u306fPDF\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u3092\u81ea\u52d5\u7684\u306b\u958b\u304d\u307e\u3059\u3002)<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPrivate Declare Function URLDownloadToFile Lib &quot;urlmon&quot; Alias &quot;URLDownloadToFileA&quot; (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long\r\n\r\nPublic Sub Sample()\r\n  GetPatentPDF &quot;JP10000002&quot;, &quot;C:\\Test&quot;\r\nEnd Sub\r\n\r\nPublic Sub GetPatentPDF(ByVal PN As String, ByVal SaveFolderPath As String)\r\n'PN:\u516c\u958b\u756a\u53f7 , SaveFolderPath:PDF\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u5148\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9\r\n  Dim Link  As String\r\n  Dim Pages As String\r\n  Dim ImgUrl As String\r\n  Dim d As Object\r\n  Dim n As Object\r\n  Dim i As Long\r\n  Const url As String = &quot;http:\/\/ops.epo.org\/2.6.2\/rest-services\/&quot;\r\n  \r\n  Set d = Nothing: Link = &quot;&quot;: Pages = &quot;&quot; '\u521d\u671f\u5316\r\n  On Error Resume Next\r\n  With CreateObject(&quot;MSXML2.XMLHTTP&quot;)\r\n    .Open &quot;GET&quot;, url &amp; &quot;published-data\/publication\/epodoc\/&quot; &amp; PN &amp; &quot;\/images&quot;, False\r\n    .setRequestHeader &quot;Content-Type&quot;, &quot;application\/x-www-form-urlencoded&quot;\r\n    .Send\r\n    If .Status &lt;&gt; 200 Then\r\n      MsgBox &quot;\u51e6\u7406\u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002&quot; &amp; vbCrLf &amp; &quot;ResponseCode:&quot; &amp; .Status, vbCritical + vbSystemModal\r\n      Exit Sub\r\n    Else\r\n      Set d = .responseXML\r\n    End If\r\n  End With\r\n  On Error GoTo 0\r\n  If Not d Is Nothing Then\r\n    For Each n In d.SelectNodes(&quot;\/ops:world-patent-data\/ops:document-inquiry\/ops:inquiry-result\/ops:document-instance&quot;)\r\n      If InStr(LCase$(n.getAttribute(&quot;desc&quot;)), &quot;full&quot;) Then\r\n        Link = n.getAttribute(&quot;link&quot;)\r\n        Pages = n.getAttribute(&quot;number-of-pages&quot;)\r\n        Exit For\r\n      End If\r\n    Next\r\n    If Len(Pages) &gt; 0 Then\r\n      '\u4fdd\u5b58\u5148\u30d5\u30a9\u30eb\u30c0\u6e96\u5099\r\n      If Right$(SaveFolderPath, 1) &lt;&gt; Application.PathSeparator Then SaveFolderPath = SaveFolderPath &amp; Application.PathSeparator\r\n      SaveFolderPath = SaveFolderPath &amp; PN\r\n      With CreateObject(&quot;Scripting.FileSystemObject&quot;)\r\n        If .FolderExists(SaveFolderPath) Then .DeleteFolder SaveFolderPath\r\n        .CreateFolder SaveFolderPath\r\n      End With\r\n      For i = 1 To CLng(Pages)\r\n        ImgUrl = url &amp; Link &amp; &quot;.pdf?Range=&quot; &amp; i 'pdf\u6c7a\u3081\u6253\u3061\r\n        URLDownloadToFile 0&amp;, ImgUrl, SaveFolderPath &amp; Application.PathSeparator &amp; PN &amp; &quot;-&quot; &amp; CStr(i) &amp; &quot;.pdf&quot;, 0&amp;, 0&amp;\r\n      Next\r\n      CreateObject(&quot;Shell.Application&quot;).Open SaveFolderPath &amp; Application.PathSeparator\r\n    End If\r\n  End If\r\nEnd Sub<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_01-300x269.jpg\" alt=\"\" title=\"GetPatentPDF_01\" width=\"300\" height=\"269\" class=\"alignnone size-medium wp-image-1741\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_01-300x269.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_01-290x260.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_01-150x134.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_01.jpg 495w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_02-300x240.jpg\" alt=\"\" title=\"GetPatentPDF_02\" width=\"300\" height=\"240\" class=\"alignnone size-medium wp-image-1742\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_02-300x240.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_02-290x232.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_02-150x120.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetPatentPDF_02.jpg 745w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306fAPI\u306e\u3054\u304f\u4e00\u90e8\u306e\u6a5f\u80fd\u3057\u304b\u4f7f\u3063\u3066\u3044\u306a\u3044\u5358\u7d14\u306a\u30de\u30af\u30ed\u3067\u3001\u30a8\u30e9\u30fc\u51e6\u7406\u3082\u304b\u306a\u308a\u624b\u3092\u629c\u3044\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3088\u308a\u7d30\u3084\u304b\u306a\u5236\u5fa1\u3092\u5fc5\u8981\u3068\u3059\u308b\u5834\u5408\u3084\u305d\u306e\u4ed6\u306e\u691c\u7d22\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u5834\u5408\u306f\u3001\u4e0b\u8a18Web\u30da\u30fc\u30b8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308bAPI\u306e\u8cc7\u6599(<span style=\"color: #ff0000; font-weight: bold;\">Open Patent Services RESTful Web Services Reference Guide<\/span>)\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>\u30fbOpen Patent Services (OPS)<\/strong><br \/>\n<a href=\"http:\/\/www.epo.org\/searching\/free\/ops.html\" title=\"Open Patent Services (OPS)\" target=\"_blank\">http:\/\/www.epo.org\/searching\/free\/ops.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"esp@cenet(Espacenet)\u304c\u516c\u958b\u3057\u3066\u3044\u308bRESTful\u306aWeb API\u3092\u5229\u7528\u3057\u3066\u3001PDF\u516c\u5831\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u30de\u30af\u30ed\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002 \u5f15\u6570\u3068\u3057\u3066\u516c\u958b\u756a\u53f7\u3068PDF\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u5148\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9\u3092\u6e21\u3059\u3068\u3001\u6307\u5b9a [&hellip;]","protected":false},"author":1,"featured_media":7111,"comment_status":"open","ping_status":"open","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],"tags":[8,63,65,70],"class_list":["post-1740","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-word-office","tag-vba","tag-excel","tag-word","tag-espcenet"],"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-s4","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1740","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=1740"}],"version-history":[{"count":7,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1740\/revisions"}],"predecessor-version":[{"id":4022,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1740\/revisions\/4022"}],"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=1740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}