{"id":5372,"date":"2016-05-09T08:45:44","date_gmt":"2016-05-08T23:45:44","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5372"},"modified":"2016-05-24T05:48:20","modified_gmt":"2016-05-23T20:48:20","slug":"fsogetfile","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/fsogetfile\/","title":{"rendered":"FileSystemObject\uff1aFile \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\uff08GetFile\uff09"},"content":{"rendered":"<h2>File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\uff08GetFile \u30e1\u30bd\u30c3\u30c9\uff09<\/h2>\n<div class=\"m30-l\">\n<p>FileSystemObject\uff08FSO\uff09\u3092\u4f7f\u7528\u3057\u3066\u3001File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002FileSystemObject\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>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>GetFile<\/strong> ( <em>filepath<\/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>FileSystemObject \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>filepath&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u53d6\u5f97\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u542b\u3080\u540d\u524d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u307f\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u3001\u30ab\u30ec\u30f3\u30c8\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u5bfe\u8c61\u3068\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution8\"><em>filepath<\/em> \u3067\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<br \/><br \/>\n<h2>File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4e3b\u306a\u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<table>\n<tr>\n<td align=\"center\" width=\"250\" bgcolor=\"#ffffccc\"><strong> \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong><\/td>\n<td align=\"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsoattributes\/\">Attributes \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u306e\u5c5e\u6027\u3092\u53d6\u5f97\u307e\u305f\u306f\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsodatecreated\/\">DateCreated \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u65e5\u6642\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsodatelastaccessed\/\">DateLastAccessed \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u6700\u5f8c\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u65e5\u6642\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsodatelastmodified\/\">DateLastModified \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u6700\u5f8c\u306b\u66f4\u65b0\u3055\u308c\u305f\u65e5\u6642\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsodriveproperty\/\">Drive \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u30c9\u30e9\u30a4\u30d6\u6587\u5b57\uff08\u300cC:\u300d\u300cD:\u300d\u306a\u3069\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsofilefoldername\/\">Name \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3092\u53d6\u5f97\u307e\u305f\u306f\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsoparentfolder\/\">ParentFolder \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30d5\u30a9\u30eb\u30c0\uff08Folder \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsofilefolderpath\/\">Path \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsoshortpathname\/\">ShortName \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">8.3\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsoshortpathname\/\">ShortPath \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">8.3\u5f62\u5f0f\u306e\u30d1\u30b9\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsosize\/\">Size \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u306e\u5bb9\u91cf\u3092\u30d0\u30a4\u30c8\u5358\u4f4d\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsotype\/\">Type \u30d7\u30ed\u30d1\u30c6\u30a3<\/a><\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u306e\u7a2e\u985e\u3092\u3042\u3089\u308f\u3059\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<\/div>\n<br \/><br \/>\n<h2>File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4e3b\u306a\u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<table>\n<tr>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffccc\"><strong>\u30e1\u30bd\u30c3\u30c9<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsocopy\/\">Copy \u30e1\u30bd\u30c3\u30c9<\/a><\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsodelete\/\">Delete \u30e1\u30bd\u30c3\u30c9<\/a><\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsomove\/\">Move \u30e1\u30bd\u30c3\u30c9<\/a><\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u3092\u79fb\u52d5\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\"><a href=\"https:\/\/excelwork.info\/excel\/fsoopenastextstream\/\">OpenAsTextStream \u30e1\u30bd\u30c3\u30c9<\/a><\/td>\n<td width=\"400\">\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\uff08TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u958b\u304d\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<\/div>\n<br \/><br \/>\n<h2>GetFile \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=\"GetFile \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_GetFile()\r\n    \r\n    Dim fso As New FileSystemObject\r\n    Dim myFile As File\r\n    \r\n    Set myFile = fso.GetFile(\"C:\\Documents\\data3\\book01.xlsx\")\r\n    \r\n    MsgBox \"\u540d\u524d\uff1a\" & myFile.Name & vbCrLf & _\r\n           \"\u30b5\u30a4\u30ba\uff1a\" & myFile.Size & vbCrLf\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_getfile01.jpg?ssl=1\" rel=\"lightbox[5372]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_getfile01.jpg?resize=172%2C170&#038;ssl=1\" alt=\"FSO GetFile \u30e1\u30bd\u30c3\u30c9\" width=\"172\" height=\"170\" class=\"alignnone size-full wp-image-5373\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_getfile01.jpg?w=172&amp;ssl=1 172w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_getfile01.jpg?resize=100%2C100&amp;ssl=1 100w\" sizes=\"(max-width: 172px) 100vw, 172px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\uff08GetFile \u30e1\u30bd\u30c3\u30c9\uff09 FileSystemO &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5373,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[836],"tags":[693,722,854,63,38],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_getfile01.jpg?fit=172%2C170&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1oE","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5372"}],"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=5372"}],"version-history":[{"count":8,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5372\/revisions"}],"predecessor-version":[{"id":5573,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5372\/revisions\/5573"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5373"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}