{"id":5308,"date":"2016-04-07T19:45:11","date_gmt":"2016-04-07T10:45:11","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5308"},"modified":"2016-05-21T09:02:11","modified_gmt":"2016-05-21T00:02:11","slug":"fsocreatetextfile","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/fsocreatetextfile\/","title":{"rendered":"FileSystemObject\uff1a\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\uff08CreateTextFile \u30e1\u30bd\u30c3\u30c9\uff09"},"content":{"rendered":"<h2>\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\uff08CreateTextFile \u30e1\u30bd\u30c3\u30c9\uff09<\/h2>\n<div class=\"m30-l\">\n<p><strong>FileSystemObject\uff08FSO\uff09<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u3001\u30c6\u30ad\u30b9\u30c8\u3092\u4f5c\u6210\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>    <em>object<\/em>.<strong>CreateTextFile<\/strong> ( <em>filename<\/em> [, <em>overwrite<\/em> ,<em>unicode<\/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> \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>filename&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4f5c\u6210\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u542b\u3080\u540d\u524d\u3092\u6587\u5b57\u5217\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>overwrite&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<em>filename<\/em> \u3067\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u3001\u4e0a\u66f8\u304d\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u793a\u3059 <strong>Boolean<\/strong> \u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<strong>True<\/strong> \u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001\u4e0a\u66f8\u304d\u3057\u3001<strong>False<\/strong> \u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u4e0a\u66f8\u304d\u3057\u307e\u305b\u3093\u3002\u65e2\u5b9a\u5024\u306f\u3001<strong>False<\/strong> \u3067\u3059\u3002<\/li>\n<li>unicode&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;Unicode \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u304b\u3001ASCII \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u304b\u3092\u793a\u3059 <strong>Boolean<\/strong> \u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002Unicode \u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f <strong>True<\/strong>\u3001ASCII \u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f <strong>False<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u3001ASCII \u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/li>\n<li>\u623b\u308a\u5024&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u65b0\u898f\u4f5c\u6210\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u3059 <strong>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution8\">\u5f15\u6570 <em>overwrite<\/em> \u304c <strong>False<\/strong> \u306e\u5834\u5408\u3001\u307e\u305f\u306f\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u3001\u5f15\u6570 <em>filename<\/em> \u304c\u65e2\u306b\u5b58\u5728\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution4\"><strong>FSO<\/strong> \u3092\u4f7f\u3063\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/fsotextstream\/\">FileSystemObject\uff1a\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3059\u308b\uff08TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<br \/><br \/>\n<h2>CreateTextFile \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=\"CreateTextFile \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_CreateTextFile()\r\n\r\n    Dim fso As New FileSystemObject\r\n    Dim myFile As TextStream\r\n    \r\n    Set myFile = fso.CreateTextFile( _\r\n                    FileName:=\"C:\\Documents\\data\\mytext1.txt\", _\r\n                    overwrite:=True, _\r\n                    Unicode:=False)\r\n    \r\n    myFile.WriteLine (\"\u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059\uff01\")\r\n    myFile.WriteLine (\"\u3055\u3088\u3046\u306a\u3089\u3002\")\r\n\r\n    myFile.Close\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u4f5c\u6210\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/03\/fso_createtextfile01.jpg?ssl=1\" rel=\"lightbox[5308]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/03\/fso_createtextfile01.jpg?resize=578%2C361&#038;ssl=1\" alt=\"FSO CreateTextFile \u30e1\u30bd\u30c3\u30c9\" width=\"578\" height=\"361\" class=\"alignnone size-full wp-image-5309\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/03\/fso_createtextfile01.jpg?w=578&amp;ssl=1 578w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/03\/fso_createtextfile01.jpg?resize=400%2C250&amp;ssl=1 400w\" sizes=\"(max-width: 578px) 100vw, 578px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\uff08CreateTextFile \u30e1\u30bd\u30c3\u30c9\uff09 FileSys &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5309,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[836],"tags":[721,842,693,722,834,63,38],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/03\/fso_createtextfile01.jpg?fit=578%2C361&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1nC","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5308"}],"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=5308"}],"version-history":[{"count":3,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5308\/revisions"}],"predecessor-version":[{"id":5552,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5308\/revisions\/5552"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5309"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}