{"id":5519,"date":"2016-05-23T13:54:13","date_gmt":"2016-05-23T04:54:13","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5519"},"modified":"2016-05-23T13:54:13","modified_gmt":"2016-05-23T04:54:13","slug":"fsoopentextfileclose","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/fsoopentextfileclose\/","title":{"rendered":"FileSystemObject\uff1a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30fb\u9589\u3058\u308b\uff08OpenTextFile ,Close\uff09"},"content":{"rendered":"<h2>\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\uff08OpenTextFile \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\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u306e\u8aad\u307f\u53d6\u308a\u3084\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u66f8\u304d\u8fbc\u307f\u306b\u4f7f\u7528\u3067\u304d\u308b <strong>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3092\u53d6\u5f97\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>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>OpenTextFile<\/strong> ( <em>filename<\/em> [, <em>iomode<\/em>, <em>create<\/em>, <em>format<\/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>filename&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u30d1\u30b9\u3092\u542b\u3080\uff09\u3092\u6587\u5b57\u5217\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>iomode&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5165\u529b\u30e2\u30fc\u30c9\u307e\u305f\u306f\u51fa\u529b\u30e2\u30fc\u30c9\u3092\u793a\u3059\u5b9a\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u3059\u308b\u3068\u8aad\u307f\u8fbc\u307f\u5c02\u7528\u30e2\u30fc\u30c9\u3067\u958b\u304d\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffccc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"80\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"320\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\">ForReading<\/td>\n<td width=\"80\" align = \"center\">1<\/td>\n<td width=\"320\">\u8aad\u307f\u53d6\u308a\u5c02\u7528\u30e2\u30fc\u30c9\u3067\u958b\u304d\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">ForWriteing<\/td>\n<td width=\"80\" align = \"center\">2<\/td>\n<td width=\"320\">\u66f8\u304d\u8fbc\u307f\u30e2\u30fc\u30c9\uff08\u4e0a\u66f8\u304d\uff09\u3067\u958b\u304d\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">ForAppending<\/td>\n<td width=\"80\" align = \"center\">8<\/td>\n<td width=\"320\">\u8ffd\u8a18\u30e2\u30fc\u30c9\uff08\u672b\u5c3e\u306b\u66f8\u304d\u8fbc\u307f\uff09\u3067\u958b\u304d\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<li>create&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5f15\u6570 <em>filename<\/em> \u3067\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306b\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u793a\u3059\u30d6\u30fc\u30eb\u578b\uff08Boolean\uff09\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f <strong>True<\/strong>\u3001\u4f5c\u6210\u3057\u306a\u3044\u5834\u5408\u306f <strong>False<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u53ef\u80fd\uff08\u65e2\u5b9a\u5024\u306f <strong>False<\/strong>\uff09\u3067\u3059\u3002<\/li>\n<li>format&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u958b\u304f\u30d5\u30a1\u30a4\u30eb\u306e\u5f62\u5f0f\u3092\u8868\u3059\u5b9a\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u3059\u308b\u3068\u3001ASCII \u5f62\u5f0f\u3067\u30d5\u30a1\u30a4\u30eb\u304c\u958b\u304b\u308c\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffccc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"80\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"320\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\">TristateUseDefault<\/td>\n<td width=\"80\" align = \"center\">-2<\/td>\n<td width=\"320\">\u30b7\u30b9\u30c6\u30e0\u306e\u65e2\u5b9a\u5024\u3092\u4f7f\u7528\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">TristateTrue<\/td>\n<td width=\"80\" align = \"center\">-1<\/td>\n<td width=\"320\">Unicode \u3068\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">TristateFalse<\/td>\n<td width=\"80\" align = \"center\">0<\/td>\n<td width=\"320\">ASCII \u3068\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<\/ul><\/div>\n<br \/><\/div>\n<br \/><br \/>\n<h2>Close \u30e1\u30bd\u30c3\u30c9\uff08\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\uff09<\/h2>\n<div class=\"m30-l\">\n<p>\u958b\u3044\u3066\u3044\u308b <strong>TextStream \u30d5\u30a1\u30a4\u30eb<\/strong> \u3092\u9589\u3058\u307e\u3059\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>Close<\/strong><\/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>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>OpenTextFile \/ Close \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=\"OpenTextFile \/ Close \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_FSOOpenTextFile()\r\n\r\n    Dim fso As New FileSystemObject\r\n    Dim f As TextStream\r\n    \r\n    Set f = fso.OpenTextFile(\"C:\\Documents\\mydata5\\test01.txt\", ForAppending)\r\n    f.WriteLine \"World!!\"\r\n    f.WriteLine \"\u3053\u308c\u306f\u30c6\u30b9\u30c8\u3067\u3059\u3002\"\r\n    f.Close\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\u306e\u300ctest01.txt\u300d\u306e\u5185\u5bb9<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close01.jpg?ssl=1\" rel=\"lightbox[5519]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close01.jpg?resize=463%2C292&#038;ssl=1\" alt=\"FSO OpenTextFile \u30e1\u30bd\u30c3\u30c9 \u5b9f\u884c\u524d\" width=\"463\" height=\"292\" class=\"alignnone size-full wp-image-5520\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close01.jpg?w=463&amp;ssl=1 463w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close01.jpg?resize=400%2C252&amp;ssl=1 400w\" sizes=\"(max-width: 463px) 100vw, 463px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\u5b9f\u884c\u5f8c\u306e\u300ctest01.txt\u300d\u306e\u5185\u5bb9<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close02.jpg?ssl=1\" rel=\"lightbox[5519]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close02.jpg?resize=463%2C292&#038;ssl=1\" alt=\"FSO OpenTextFile \u30e1\u30bd\u30c3\u30c9 \u5b9f\u884c\u5f8c\" width=\"463\" height=\"292\" class=\"alignnone size-full wp-image-5521\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close02.jpg?w=463&amp;ssl=1 463w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close02.jpg?resize=400%2C252&amp;ssl=1 400w\" sizes=\"(max-width: 463px) 100vw, 463px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\uff08OpenTextFile \u30e1\u30bd\u30c3\u30c9\uff09 FileSystemObj &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5520,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[836],"tags":[886,721,693,722,834,885,900,63,38],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_opentextfile_close01.jpg?fit=463%2C292&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1r1","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5519"}],"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=5519"}],"version-history":[{"count":3,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5519\/revisions"}],"predecessor-version":[{"id":5570,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5519\/revisions\/5570"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5520"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}