{"id":5470,"date":"2016-05-18T09:39:00","date_gmt":"2016-05-18T00:39:00","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5470"},"modified":"2016-05-18T09:39:00","modified_gmt":"2016-05-18T00:39:00","slug":"fsocopy","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/fsocopy\/","title":{"rendered":"FileSystemObject\uff1a\u30d5\u30a9\u30eb\u30c0\u3084\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\uff08Copy \u30e1\u30bd\u30c3\u30c9\uff09"},"content":{"rendered":"<h2>\u30d5\u30a9\u30eb\u30c0\u3084\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\uff08Copy \u30e1\u30bd\u30c3\u30c9\uff09<\/h2>\n<div class=\"m30-l\">\n<p><strong>FileSystemObject\uff08FSO\uff09<\/strong>\u3067\u3001\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u3084\u30d5\u30a1\u30a4\u30eb\u3092\u5225\u306e\u5834\u6240\u306b\u30b3\u30d4\u30fc\u3059\u308b\u306b\u306f\u3001<strong>Folder \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u307e\u305f\u306f\u3001<strong>File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u306e <strong>Copy \u30e1\u30bd\u30c3\u30c9<\/strong> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n    FileSystemObject\uff08FSO\uff09\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3059\u308b\u65b9\u6cd5\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/filesystemobject\/\">\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08FileSystemObject\uff09\u306e\u4f7f\u3044\u65b9<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>Copy<\/strong> <em>destination<\/em> [, <em>overwrite<\/em> ]<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<span class=\"red\"><strong>File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span> \u307e\u305f\u306f\u3001<span class=\"red\"><strong>Folder \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>destination&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a1\u30a4\u30eb\u307e\u305f\u306f\u30d5\u30a9\u30eb\u30c0\u306e\u30b3\u30d4\u30fc\u5148\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u6587\u5b57\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002<\/li>\n<li>overwrite&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d6\u30fc\u30eb\u578b\uff08Boolean\uff09\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u65e2\u5b58\u306e\u30d5\u30a1\u30a4\u30eb\u3084\u306f\u30d5\u30a9\u30eb\u30c0\u3092\u4e0a\u66f8\u304d\u3059\u308b\u5834\u5408\u306f <strong>True<\/strong>\uff08\u65e2\u5b9a\u5024\uff09\u3001\u4e0a\u66f8\u304d\u3057\u306a\u3044\u5834\u5408\u306f <strong>False<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u53ef\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<p class=\"caution4\">File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u95a2\u3057\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/fsogetfile\/\">FileSystemObject\uff1aFile \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\uff08GetFile\uff09<\/a> \u3001Folder \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u95a2\u3057\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/fsofolderobject\/\">FileSystemObject\uff1aFolder \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u53d6\u5f97<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>Copy \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"Copy \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_FSOCopy()\r\n\r\n    Dim fso As New FileSystemObject\r\n    Dim myFolder As Folder\r\n    Dim myFile As File\r\n    Dim aaa\r\n    Set myFolder = fso.GetFolder(\"C:\\Documents\\mydata5\\myfolder\")\r\n    Set myFile = fso.GetFile(\"C:\\Documents\\mydata5\\test01.txt\")\r\n    \r\n    myFolder.Copy Destination:=\"C:\\Documents\\mydata5\\myfolder_copy\"\r\n    myFile.Copy \"C:\\Documents\\mydata5\\test02.txt\", True\r\n    \r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy01.jpg?ssl=1\" rel=\"lightbox[5470]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy01.jpg?resize=477%2C335&#038;ssl=1\" alt=\"FSO Copy \u30e1\u30bd\u30c3\u30c9 01\" width=\"477\" height=\"335\" class=\"alignnone size-full wp-image-5471\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy01.jpg?w=477&amp;ssl=1 477w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy01.jpg?resize=400%2C281&amp;ssl=1 400w\" sizes=\"(max-width: 477px) 100vw, 477px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy02.jpg?ssl=1\" rel=\"lightbox[5470]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy02.jpg?resize=477%2C335&#038;ssl=1\" alt=\"FSO Copy \u30e1\u30bd\u30c3\u30c9 02\" width=\"477\" height=\"335\" class=\"alignnone size-full wp-image-5472\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy02.jpg?w=477&amp;ssl=1 477w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy02.jpg?resize=400%2C281&amp;ssl=1 400w\" sizes=\"(max-width: 477px) 100vw, 477px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>\u30d5\u30a9\u30eb\u30c0\u3084\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\uff08Copy \u30e1\u30bd\u30c3\u30c9\uff09 FileSystemObjec &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5471,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[836],"tags":[306,721,693,871,722,872,834,63,38],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_copy01.jpg?fit=477%2C335&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s4Ye9i-fsocopy","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5470"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=5470"}],"version-history":[{"count":3,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5470\/revisions"}],"predecessor-version":[{"id":5518,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5470\/revisions\/5518"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5471"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}