{"id":5482,"date":"2016-05-21T08:31:15","date_gmt":"2016-05-20T23:31:15","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5482"},"modified":"2016-05-21T08:31:15","modified_gmt":"2016-05-20T23:31:15","slug":"fsotextstream","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/fsotextstream\/","title":{"rendered":"FileSystemObject\uff1a\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3059\u308b\uff08TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09"},"content":{"rendered":"<h2>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/h2>\n<div class=\"m30-l\">\n<p><strong>FileSystemObject\uff08FSO\uff09<\/strong>\u306e <strong>CreateTextFile \u30e1\u30bd\u30c3\u30c9<\/strong> \u3084 <strong>OpenTextFile \u30e1\u30bd\u30c3\u30c9<\/strong>\u3001<strong>File \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u306e <strong>OpenAsTextStream \u30e1\u30bd\u30c3\u30c9<\/strong> \u3067\u3001<strong>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<br \/>\n    <strong>CreateTextFile \u30e1\u30bd\u30c3\u30c9<\/strong> \u306f\u3001\u65b0\u898f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u307e\u305f\u3001<strong>OpenTextFile \u30e1\u30bd\u30c3\u30c9<\/strong> \u3084 <strong>OpenAsTextStream \u30e1\u30bd\u30c3\u30c9<\/strong> \u306f\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3059\u3002\u8a73\u7d30\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/fsocreatetextfile\/\">\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\uff08CreateTextFile \u30e1\u30bd\u30c3\u30c9\uff09<\/a> \u3001<a href=\"https:\/\/excelwork.info\/excel\/commingsoon\">\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\uff08OpenTextFile \u30e1\u30bd\u30c3\u30c9\uff09<\/a> \u3001<a href=\"https:\/\/excelwork.info\/excel\/commingsoon\">\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\uff08OpenAsTextStream \u30e1\u30bd\u30c3\u30c9\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n    \u307e\u305f\u3001FileSystemObject\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<\/div>\n<br \/><br \/>\n<h2>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u306e\u4e3b\u306a\u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n  <br \/><\/p>\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\">Close \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">Read \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u304b\u3089\u6587\u5b57\u5217\uff08\u6307\u5b9a\u3057\u305f\u6570\u306e\u6587\u5b57\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">ReadLine \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u304b\u3089\u6587\u5b57\u5217\uff08\u884c\u5358\u4f4d\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">ReadAll \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u5168\u4f53\u306e\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">Write \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u306b\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">WriteLine \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u306b\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u3068\u6539\u884c\u6587\u5b57\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">WriteBlankLines \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u306b\u6307\u5b9a\u3057\u305f\u6570\u306e\u6539\u884c\u6587\u5b57\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">Skip \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3068\u304d\u306b\u3001\u6307\u5b9a\u6570\u306e\u6587\u5b57\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e\u3092\u79fb\u52d5\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">SkipLine \u30e1\u30bd\u30c3\u30c9<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3068\u304d\u306b\u3001\u6b21\u306e\u884c\u306b\u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e\u3092\u79fb\u52d5\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<br \/>\n<p class=\"caution4\"><strong>Close \u30e1\u30bd\u30c3\u30c9<\/strong> \u306e\u8a73\u7d30\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/commingsoon\">FileSystemObject\uff1a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30fb\u9589\u3058\u308b\uff08OpenTextFile ,Close\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n    <strong>Read \u30e1\u30bd\u30c3\u30c9\u3001ReadLine \u30e1\u30bd\u30c3\u30c9\u3001ReadAll \u30e1\u30bd\u30c3\u30c9<\/strong> \u306e\u8a73\u7d30\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/commingsoon\">TextStream \u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\uff08Read,ReadLine,ReadAll\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n    <strong>Skip \u30e1\u30bd\u30c3\u30c9\u3001SkipLine \u30e1\u30bd\u30c3\u30c9<\/strong> \u306e\u8a73\u7d30\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/commingsoon\">TextStream \u30d5\u30a1\u30a4\u30eb\u3067\u3001\u6307\u5b9a\u3055\u308c\u305f\u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e\u306b\u79fb\u52d5\uff08Skip,SkipLine\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n    <strong>Write \u30e1\u30bd\u30c3\u30c9\u3001WriteLine \u30e1\u30bd\u30c3\u30c9\u3001WriteBlankLines \u30e1\u30bd\u30c3\u30c9<\/strong> \u306e\u8a73\u7d30\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/commingsoon\">TextStream \u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u3080\uff08Write,WriteLine,WriteBlankLines\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u306e\u4e3b\u306a\u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<div class=\"m30-l\">\n  <br \/><\/p>\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\">Column \u30d7\u30ed\u30d1\u30c6\u30a3<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u5185\u306e\u73fe\u5728\u306e\u6587\u5b57\u4f4d\u7f6e\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">Line \u30d7\u30ed\u30d1\u30c6\u30a3<\/td>\n<td width=\"400\">TextStream \u30d5\u30a1\u30a4\u30eb\u5185\u306e\u884c\u982d\u304b\u3089\u306e\u73fe\u5728\u306e\u884c\u4f4d\u7f6e\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">AtEndOfLine \u30d7\u30ed\u30d1\u30c6\u30a3<\/td>\n<td width=\"400\">\u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e\u304c\u3001TextStream \u30d5\u30a1\u30a4\u30eb\u306e\u884c\u672b\u304b\u3069\u3046\u304b\u3092\u8abf\u3079\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">AtEndOfStream \u30d7\u30ed\u30d1\u30c6\u30a3<\/td>\n<td width=\"400\">\u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e\u304c\u3001TextStream \u30d5\u30a1\u30a4\u30eb\u306e\u672b\u5c3e\u304b\u3069\u3046\u304b\u3092\u8abf\u3079\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<br \/>\n<p class=\"caution4\"><strong>AtEndOfLine \u30d7\u30ed\u30d1\u30c6\u30a3\u3001AtEndOfStream \u30d7\u30ed\u30d1\u30c6\u30a3\u3001Column \u30d7\u30ed\u30d1\u30c6\u30a3\u3001Line \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u306e\u8a73\u7d30\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/commingsoon\">TextStream \u30d5\u30a1\u30a4\u30eb\u306e\u4f4d\u7f6e\uff08AtEndOfLine,AtEndOfStream,Column,Line\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \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=\"TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_FSOTextStream()\r\n\r\n    Dim fso As New FileSystemObject\r\n    Dim TStream As TextStream\r\n        \r\n    '\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\uff08TextStrem \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\uff09\r\n    Set TStream = fso.OpenTextFile(\"C:\\Documents\\data\\mytext1.txt\")\r\n\r\n    '\u30d5\u30a1\u30a4\u30eb\u5185\u5bb9\u3092\u53d6\u5f97\u3057\u3066\u8868\u793a\r\n    MsgBox TStream.ReadAll\r\n    \r\n    '\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\r\n    TStream.Close\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_textstream01.jpg?ssl=1\" rel=\"lightbox[5482]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream01.jpg?resize=168%2C170&#038;ssl=1\" alt=\"FSO TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\" width=\"168\" height=\"170\" class=\"alignnone size-full wp-image-5483\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream01.jpg?w=168&amp;ssl=1 168w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream01.jpg?resize=100%2C100&amp;ssl=1 100w\" sizes=\"(max-width: 168px) 100vw, 168px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 FileSystemObject\uff08FSO\uff09\u306e &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5483,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[836],"tags":[895,896,886,297,721,842,693,722,897,834,899,885,887,889,888,893,894,63,890,898,891,38],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream01.jpg?fit=168%2C170&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1qq","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5482"}],"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=5482"}],"version-history":[{"count":8,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5482\/revisions"}],"predecessor-version":[{"id":5546,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5482\/revisions\/5546"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5483"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}