{"id":1973,"date":"2024-06-10T12:49:21","date_gmt":"2024-06-10T03:49:21","guid":{"rendered":"https:\/\/euc-access-excel-db.com\/tips\/?p=1973"},"modified":"2024-06-27T11:15:58","modified_gmt":"2024-06-27T02:15:58","slug":"base64encode01","status":"publish","type":"post","link":"https:\/\/euc-access-excel-db.com\/tips\/ct09_biz-pctec\/base64encode01","title":{"rendered":"ExcelVBA\uff5e\u30d5\u30a1\u30a4\u30eb\u3092Base64\u30a8\u30f3\u30b3\u30fc\u30c9\u30fb\u30c7\u30b3\u30fc\u30c9\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>ExcelVBA\uff5e\u30d5\u30a1\u30a4\u30eb\u3092Base64\u30a8\u30f3\u30b3\u30fc\u30c9\u30fb\u30c7\u30b3\u30fc\u30c9\u3059\u308b\u65b9\u6cd5<\/p>\n<p><SPAN>\u3000\u3000<\/SPAN><br \/>\n<span style=\"color: #ff0000;\">\u203b\u307e\u3060\u66f8\u304d\u304b\u3051\u3067\u3059\u3002\u3059\u307f\u307e\u305b\u3093\u3002<\/span><br \/>\n<span style=\"color: #ff0000;\">\u203b\u9593\u9055\u3063\u3066\u305f\u3089\u3059\u307f\u307e\u305b\u3093\u3002<\/span><br \/>\n<span style=\"color: #ff0000;\">\u203b\u30e1\u30e2\u66f8\u304d\u306a\u306e\u3067\u3001\u81ea\u5206\u3067\u3082\u610f\u5473\u4e0d\u660e\u306a\u7b87\u6240\u3082\u591a\u3044\u3067\u3059\u3002\u3054\u3081\u3093\u306a\u3055\u3044\u3002<\/span><br \/>\n<SPAN>\u3000\u3000<\/SPAN><\/p>\n<p><a href=\"https:\/\/euc-access-excel-db.com\/00000WPZIP\/EncodeDecordSample.zip\" target=\"_blank\" rel=\"noopener\">\u2605\u30a8\u30f3\u30b3\u30fc\u30c9\u30c7\u30b3\u30fc\u30c9\u30b5\u30f3\u30d7\u30eb\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><br \/>\n\uff08base64\u30a8\u30f3\u30b3\u30fc\u30c9\u3068\u30c7\u30b3\u30fc\u30c9\u3001quoted-printable\u30c7\u30b3\u30fc\u30c9\u3001URL\uff1d\u30d1\u30fc\u30bb\u30f3\u30c8\u30c7\u30b3\u30fc\u30c9\u3001Yahoo\u77e5\u6075\u888b\u30a4\u30f3\u30c7\u30f3\u30c8\u5909\u63db\u3001\u306e\u30b3\u30fc\u30c9\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002\uff09<br \/>\n<SPAN>\u3000\u3000<\/SPAN><\/p>\n<p><a href=\"https:\/\/detail.chiebukuro.yahoo.co.jp\/qa\/question_detail\/q10298915845\" target=\"_blank\" rel=\"noopener\">https:\/\/detail.chiebukuro.yahoo.co.jp\/qa\/question_detail\/q10298915845<\/a><\/p>\n<p>\u300c\u30d5\u30a1\u30a4\u30eb\u3092Base64\u30a8\u30f3\u30b3\u30fc\u30c9\u30fb\u30c7\u30b3\u30fc\u30c9\u3059\u308bVBA\u30de\u30af\u30ed\u300d<br \/>\n<a href=\"https:\/\/www.ka-net.org\/blog\/?p=4479\" target=\"_blank\" rel=\"noopener\">https:\/\/www.ka-net.org\/blog\/?p=4479<\/a><br \/>\n\u3092\u5c11\u3057\u52a0\u5de5\u3002<\/p>\n<p>Web\u691c\u7d22\u3057\u3066\u307f\u305f\u3089\u3001<br \/>\n\u300c\u30d5\u30a1\u30a4\u30eb\u3092Base64\u30a8\u30f3\u30b3\u30fc\u30c9\u30fb\u30c7\u30b3\u30fc\u30c9\u3059\u308bVBA\u30de\u30af\u30ed\u300d<br \/>\n<a href=\"https:\/\/www.ka-net.org\/blog\/?p=4479\" target=\"_blank\" rel=\"noopener\">https:\/\/www.ka-net.org\/blog\/?p=4479<\/a><br \/>\n\u3068\u3044\u3046\u306e\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>Base64\u30a8\u30f3\u30b3\u30fc\u30c9\u3068\u306f\uff1f<br \/>\n<a href=\"https:\/\/wa3.i-3-i.info\/word11338.html\" target=\"_blank\" rel=\"noopener\">https:\/\/wa3.i-3-i.info\/word11338.html<\/a><\/p>\n<p>\u5f53\u65b9\u3067Function\u3092Private \u304b\u3089Public\u306b\u5909\u66f4\u5f8c\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u305f\u3089\u3001<br \/>\nxlsx\u3082PDF\u3082\u3001<br \/>\n\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u305f\u7d50\u679c\u3092\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306b\u3044\u3063\u305f\u3093\u5165\u308c\u3066\u3001<br \/>\n\u305d\u306e\u306e\u3061\u3001\u305d\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306e\u5024\u3092\u3082\u3068\u306b\u30c7\u30b3\u30fc\u30c9\u3057\u305f\u3089\u3001<br \/>\nxlsx\u3001PDF\u3001\u3068\u3082\u306b\u3001\u6b63\u5e38\u306b\uff1f\u5fa9\u5143\u3055\u308c\u307e\u3057\u305f\u30fb\u30fb\u30fb\u30fb\u3002<br \/>\n\u3059\u3079\u3066\u306exlsx\u3084PDF\u3092\u5b8c\u74a7\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3001\u30c7\u30b3\u30fc\u30c9\u3001\u3067\u304d\u308b\u306e\u304b\u306f<br \/>\n\u81ea\u5206\u306b\u306f\u308f\u304b\u308a\u307e\u305b\u3093\u304c\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u30bb\u30eb\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u305f\u5024\u3092\u5165\u308c\u305f\u3089\u3001\uff11\u30bb\u30eb\u3060\u3051\u3067\u306f\u8db3\u308a\u307e\u305b\u3093\u3067\u3001<br \/>\n\u30c7\u30b3\u30fc\u30c9\u304c\u6b63\u5e38\u306b\u884c\u3048\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n\u30bb\u30eb\u306b\u4fdd\u5b58\u3059\u308b\u306a\u3089\u30011\u884c1\u30bb\u30eb\u3001\u306e\u3088\u3046\u306b\u8907\u6570\u884c\u304c\u5fc5\u8981\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3042\u308b\u3044\u306f\u3001\u30a8\u30f3\u30b3\u30fc\u30c9\u306f\u3001<br \/>\n\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3084\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u66f8\u304d\u51fa\u3059\u3068\u304b\u3001<br \/>\n\u5927\u91cf\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u66f8\u304d\u51fa\u305b\u308b\u3082\u306e\u306b\u66f8\u304d\u51fa\u3057\u305f\u307b\u3046\u304c\u3044\u3044\u304b\u3082\uff1f\u3067\u3059\u3002<\/p>\n<p>==============<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u3001\u30a8\u30f3\u30b3\u30fc\u30c9\u7d50\u679c\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u9001\u3063\u3066\u3082\u3001<br \/>\n\u305d\u306e\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306e\u5185\u5bb9\u304b\u3089\u3001<br \/>\nxlsx\u3001PDF\u3001\u3068\u3082\u306b\u3001\u6b63\u5e38\u306b\uff1f\u5fa9\u5143\u3055\u308c\u307e\u3057\u305f\u30fb\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306e\u30c7\u30fc\u30bf\u3092\u3001\u3044\u3063\u305f\u3093\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u8cbc\u308a\u4ed8\u3051\u3001<br \/>\n\u305d\u308c\u3092\u3059\u3079\u3066\u9078\u629e\u3057\u3066\u304b\u3089\u3001\u30b3\u30d4\u30fc\u3001\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u5f8c\u3001<br \/>\nDecodeBase64 \u3092\u5b9f\u884c\u3057\u3066\u3082\uff2f\uff2b\u3067\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u3082\u3059\u3079\u3066\u306exlsx\u3084PDF\u3092\u5b8c\u74a7\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3001\u30c7\u30b3\u30fc\u30c9\u3001\u3067\u304d\u308b\u306e\u304b\u306f<br \/>\n\u81ea\u5206\u306b\u306f\u308f\u304b\u308a\u307e\u305b\u3093\u304c\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306e\u30c7\u30fc\u30bf\u3092\u30b2\u30c3\u30c8\u3057\u305f\u308a\u3001\u9001\u3063\u305f\u308a\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>\uff1d\uff1d\uff1d\uff1d<\/p>\n<p>'\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30c7\u30fc\u30bf\u3092\u9001\u308b\u3002<br \/>\nFunction Sendcb(s_FPath As String)<\/p>\n<p>    Dim o_cpb As Object<br \/>\n    Set o_cpb = CreateObject(\"new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}\")<br \/>\n    '\u2191\u300cMicrosoft Forms 2.0 Object Library\u300d\u3068\u66f8\u304f\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u306e\u3067<br \/>\n    '  \u300cnew:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}\u300d\u3068\u66f8\u304f\u3002<\/p>\n<p>    With o_cpb<br \/>\n        .SetText s_FPath    '\u5909\u6570\u306e\u30c7\u30fc\u30bf\u3092DataObject\u306b\u683c\u7d0d<br \/>\n        .PutInClipboard     'DataObject\u306e\u30c7\u30fc\u30bf\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u683c\u7d0d<br \/>\n    End With<\/p>\n<p>End Function<\/p>\n<p>'\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306e\u5024\u3092\u30b2\u30c3\u30c8\u3059\u308b\u3002<br \/>\nFunction Getcbdata() As String<\/p>\n<p>    Dim o_cpb As Object<br \/>\n    Set o_cpb = CreateObject(\"new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}\")<br \/>\n    '\u2191\u300cMicrosoft Forms 2.0 Object Library\u300d\u3068\u66f8\u304f\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u306e\u3067<br \/>\n    '  \u300cnew:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}\u300d\u3068\u66f8\u304f\u3002<\/p>\n<p>    On Error Resume Next<br \/>\n    With o_cpb<br \/>\n        .GetFromClipboard<br \/>\n        Getcbdata = .GetText<br \/>\n    End With<\/p>\n<p>End Function<\/p>\n<p>\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d<\/p>\n<p>\u8003\u3048\u9055\u3044\u3057\u3066\u305f\u3089\u3054\u3081\u3093\u306a\u3055\u3044\u3002<\/p>\n<p>=============================================================================================<br \/>\n\u4ee5\u4e0a\u3001\u77e5\u6075\u888b\u56de\u7b54<br \/>\n=============================================================================================<br \/>\n=============================================================================================<br \/>\n=============================================================================================<br \/>\n=============================================================================================<br \/>\n=============================================================================================<br \/>\n\u4ee5\u4e0b\u3001\u5168\u4f53\u306e\u30b3\u30fc\u30c9\u3002<br \/>\n=============================================================================================<\/p>\n<pre class=\"lang:default decode:true \">\r\n'\r\n'\r\n\r\n\r\nOption Explicit\r\n\r\nDim s_TempTxt01 As String '\u30a8\u30f3\u30b3\u30fc\u30c9\u7d50\u679c\u3092\u5165\u308c\u308b\u305f\u3081\u306e\u30c6\u30b9\u30c8\u7528\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3002\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306e\u4ee3\u308f\u308a\u306b\u3053\u308c\u3092\u4f7f\u3063\u3066\u3082\u3044\u3044\u3002\r\n\r\n\r\n'\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092Base64\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066\u3001\u305d\u306e\u7d50\u679c\u306e\u30c6\u30ad\u30b9\u30c8\u5185\u5bb9\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u9001\u308b\u3002\r\nPublic Sub SendcbEncodeTest01()\r\n  Call Sendcb(EncodeBase64(\"D:\\1\\decord03.pdf\"))\r\nEnd Sub\r\n\r\n\r\n'Base64\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u4fdd\u6301\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u5185\u5bb9\u304b\u3089\u3001\u30c7\u30b3\u30fc\u30c9\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u5fa9\u5143\u3059\u308b\u3002\r\n'\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306e\u305d\u306e\u5185\u5bb9\u3092\u3001\u3044\u3063\u305f\u3093\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u30b3\u30d4\u30da\u3057\u3001\r\n'\u305d\u306e\u5f8c\u3001\u305d\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u5207\u308a\u53d6\u308a\u3084\u30b3\u30d4\u30fc\u3092\u3057\u3066\u3082\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u5fa9\u5143\u3067\u304d\u307e\u3059\u3002\r\nPublic Sub GetcbdataDEcodeTest01()\r\n  Call DecodeBase64(Getcbdata, \"D:\\1\\decord04.pdf\")\r\nEnd Sub\r\n\r\n'\u300cBase64\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u6587\u5b57\u306e\u7f85\u5217\u304c\u8a18\u9332\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u300d\u306e\u5185\u5bb9\u304b\u3089\u3001\r\n'\u305d\u308c\u3092\u30c7\u30b3\u30fc\u30c9\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u5fa9\u5143\u3059\u308b\u3002\r\n\r\nPublic Sub DecordFromTxtBodyTest01()\r\n\r\n    Dim s_TxtBody01 As String\r\n    '\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u672c\u6587\u5185\u5bb9\u3092\u4e00\u767a\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e\u5909\u6570\u3002\r\n    \r\n    Let s_TxtBody01 = TxtAllBundleRead01(\"d:\\1\\decord06.txt\")\r\n    '\u300cBase64\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u6587\u5b57\u306e\u7f85\u5217\u304c\u8a18\u9332\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u300d\u304b\u3089\r\n    '\u305d\u306e\u5185\u5bb9\u3092\u4e00\u62ec\u8aad\u307f\u3002\r\n    \r\n    Call DecodeBase64(s_TxtBody01, \"D:\\1\\decord06.xlsx\")\r\n    '\u305d\u306e\u5185\u5bb9\u304b\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u5fa9\u5143\u3002\r\n    '\u62e1\u5f35\u5b50\u306a\u3057\u3067\u5b9f\u884c\u3057\u3066\u3001\u3042\u3068\u304b\u3089\u3001\u8272\u3005\u306b\u62e1\u5f35\u5b50\u3092\u8a66\u3057\u3066\u3082OK\u3067\u3059\u3002\r\n    \r\nEnd Sub\r\n\r\n\r\n'=============\r\n'=============\r\n\r\n'\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30c7\u30fc\u30bf\u3092\u9001\u308b\uff08\u3060\u3051\uff09\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3002\r\nFunction Sendcb(s_FPath As String)\r\n\r\n    Dim o_cpb As Object\r\n    Set o_cpb = CreateObject(\"new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}\")\r\n    '\u2191CreateObject\u95a2\u6570\u306e\u30af\u30e9\u30b9\u540d\u306e\u6307\u5b9a\u3067\u300cMSForms.DataObject\u300d\u3068\u66f8\u304f\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u306e\u3067\r\n    '  \u300cnew:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}\u300d\u3068\u66f8\u304f\u3002\r\n    \r\n    With o_cpb\r\n        .SetText s_FPath    '\u5909\u6570\u306e\u30c7\u30fc\u30bf\u3092DataObject\u306b\u683c\u7d0d\r\n        .PutInClipboard     'DataObject\u306e\u30c7\u30fc\u30bf\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u683c\u7d0d\r\n    End With\r\n    \r\nEnd Function\r\n\r\n\r\n'\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306e\u5024\u3092\u30b2\u30c3\u30c8\u3059\u308b\uff08\u3060\u3051\uff09\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3002\r\nFunction Getcbdata() As String\r\n\r\n    Dim o_cpb As Object\r\n    Set o_cpb = CreateObject(\"new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}\")\r\n    '\u2191\u540c\u3058\u304f\u3001CreateObject\u95a2\u6570\u306e\u30af\u30e9\u30b9\u540d\u306e\u6307\u5b9a\u3067\u300cMSForms.DataObject\u300d\u3068\u66f8\u304f\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u306e\u3067\r\n    '  \u300cnew:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}\u300d\u3068\u66f8\u304f\u3002\r\n    \r\n    On Error Resume Next\r\n    With o_cpb\r\n        .GetFromClipboard\r\n        Getcbdata = .GetText\r\n    End With\r\n\r\nEnd Function\r\n\r\n\r\n'\u6307\u5b9a\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u3001\u30eb\u30fc\u30d7\u3092\u4f7f\u308f\u305a\u306b\u4e00\u767a\u3067\u5185\u5bb9\u3092\u8aad\u307f\u8fbc\u3080\r\n'https:\/\/vbanobuhinko.com\/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E4%B8%80%E6%8B%AC%E8%AA%AD%E3%81%BF%E8%BE%BC%E3%81%BF%E3%81%99%E3%82%8B\/\r\n\r\nFunction TxtAllBundleRead01(s_Path As String) As String\r\n    \r\n    Dim bhTxt As String\r\n    \r\n    'FSO\u306e\u5ba3\u8a00\r\n    Dim bhFSO As Object\r\n    Dim bhFSOT As Object\r\n    \r\n    Set bhFSO = CreateObject(\"Scripting.FileSystemObject\")\r\n    '\u6307\u5b9a\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\r\n'    Set bhFSOT = bhFSO.OpenTextFile(\"\u6307\u5b9a\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u7d76\u5bfe\u30d1\u30b9\")\r\n    Set bhFSOT = bhFSO.OpenTextFile(s_Path)\r\n    \r\n    '\u958b\u3044\u305f\u30c6\u30ad\u30b9\u30c8\u30921\u3064\u306e\u30c7\u30fc\u30bf\u306b\u4e00\u62ec\u8aad\u307f\u8fbc\u307f\r\n\r\n    Let bhTxt = bhFSOT.ReadAll\r\n    \r\n    Let TxtAllBundleRead01 = bhTxt\r\n    \r\n    'FSO\u306e\u89e3\u653e\r\n    Set bhFSOT = Nothing\r\n    Set bhFSO = Nothing\r\n\r\nEnd Function\r\n\r\n'=============\r\n'=============\r\n\r\n'Base64\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\uff08\uff1d\u30d5\u30a1\u30a4\u30eb\u3092\u6587\u5b57\u5316\u3059\u308b\uff09\r\nFunction EncodeBase64(ByVal FilePath As String) As String\r\n'\u30d5\u30a1\u30a4\u30eb\u3092Base64\u30a8\u30f3\u30b3\u30fc\u30c9\r\n  Dim elm As Object\r\n  Dim ret As String\r\n  Const adTypeBinary = 1\r\n  Const adReadAll = -1\r\n   \r\n  ret = \"\" '\u521d\u671f\u5316\r\n  On Error Resume Next\r\n  Set elm = CreateObject(\"MSXML2.DOMDocument\").createElement(\"base64\")\r\n  With CreateObject(\"ADODB.Stream\")\r\n    .Type = adTypeBinary\r\n    .Open\r\n    .LoadFromFile FilePath\r\n    elm.DataType = \"bin.base64\"\r\n    elm.nodeTypedValue = .Read(adReadAll)\r\n    ret = elm.Text\r\n    .Close\r\n  End With\r\n  On Error GoTo 0\r\n  EncodeBase64 = ret\r\nEnd Function\r\n \r\n\r\n\r\n'Base64\u3067\u30c7\u30b3\u30fc\u30c9\u3059\u308b\uff08\uff1d\u30a8\u30f3\u30b3\u30fc\u30c9\u3067\u6587\u5b57\u5316\u3055\u308c\u305f\u3082\u306e\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u306b\u5fa9\u5143\u3059\u308b\uff09\r\nFunction DecodeBase64(ByVal Base64Str As String, ByVal FilePath As String) As Long\r\n'\u30d5\u30a1\u30a4\u30eb\u3092Base64\u30c7\u30b3\u30fc\u30c9\r\n  Dim elm As Object\r\n  Dim ret As Long\r\n  Const adTypeBinary = 1\r\n  Const adSaveCreateOverWrite = 2\r\n   \r\n  ret = -1 '\u521d\u671f\u5316\r\n  On Error Resume Next\r\n  Set elm = CreateObject(\"MSXML2.DOMDocument\").createElement(\"base64\")\r\n  elm.DataType = \"bin.base64\"\r\n  elm.Text = Base64Str\r\n  With CreateObject(\"ADODB.Stream\")\r\n    .Type = adTypeBinary\r\n    .Open\r\n    .Write elm.nodeTypedValue\r\n    .SaveToFile FilePath, adSaveCreateOverWrite\r\n    .Close\r\n  End With\r\n  If Err.Number <> 0 Then ret = 0\r\n  On Error GoTo 0\r\n  DecodeBase64 = ret\r\nEnd Function\r\n\r\n\r\n'\r\n'\r\n<\/pre>\n<p><SPAN>\u3000\u3000<\/SPAN><\/p>\n<p><SPAN>\u3000\u3000<\/SPAN><br \/>\n<SPAN>\u3000\u3000<\/SPAN><br \/>\n<SPAN>\u3000\u3000<\/SPAN><\/p>\n","protected":false},"excerpt":{"rendered":"ExcelVBA\uff5e\u30d5\u30a1\u30a4\u30eb\u3092Base64\u30a8\u30f3\u30b3\u30fc\u30c9\u30fb\u30c7\u30b3\u30fc\u30c9\u3059\u308b\u65b9\u6cd5 \u3000\u3000 \u203b\u307e\u3060\u66f8\u304d\u304b\u3051\u3067\u3059\u3002\u3059\u307f\u307e\u305b\u3093\u3002 \u203b\u9593\u9055\u3063\u3066\u305f\u3089\u3059\u307f\u307e\u305b\u3093\u3002 \u203b\u30e1\u30e2\u66f8\u304d\u306a\u306e\u3067\u3001\u81ea\u5206\u3067\u3082\u610f\u5473\u4e0d\u660e\u306a\u7b87\u6240\u3082\u591a\u3044\u3067\u3059\u3002\u3054\u3081\u3093\u306a\u3055\u3044\u3002 \u3000\u3000 \u2605\u30a8\u30f3\u30b3 ...","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"_links":{"self":[{"href":"https:\/\/euc-access-excel-db.com\/tips\/wp-json\/wp\/v2\/posts\/1973"}],"collection":[{"href":"https:\/\/euc-access-excel-db.com\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/euc-access-excel-db.com\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/euc-access-excel-db.com\/tips\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/euc-access-excel-db.com\/tips\/wp-json\/wp\/v2\/comments?post=1973"}],"version-history":[{"count":0,"href":"https:\/\/euc-access-excel-db.com\/tips\/wp-json\/wp\/v2\/posts\/1973\/revisions"}],"wp:attachment":[{"href":"https:\/\/euc-access-excel-db.com\/tips\/wp-json\/wp\/v2\/media?parent=1973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/euc-access-excel-db.com\/tips\/wp-json\/wp\/v2\/categories?post=1973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}