{"id":2526,"date":"2024-05-06T14:57:27","date_gmt":"2024-05-06T05:57:27","guid":{"rendered":"https:\/\/weblog.hirohiro716.com\/?p=2526"},"modified":"2024-05-06T21:47:56","modified_gmt":"2024-05-06T12:47:56","slug":"%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%b8%e6%9b%b8%e3%81%8d%e5%87%ba%e3%81%99","status":"publish","type":"post","link":"https:\/\/weblog.hirohiro716.com\/?p=2526","title":{"rendered":"LibreOffice\u3067\u6587\u5b57\u5217\u3092\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3078\u66f8\u304d\u51fa\u3059"},"content":{"rendered":"<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nDim saveFilePath As String\r\nsaveFilePath = &quot;\/tmp\/test.txt&quot;\r\nDim lines as Object\r\nlines = New Collection\r\nlines.Add(&quot;test1&quot;)\r\nlines.Add(&quot;test2&quot;)\r\nDim simpleFileAccess As Object\r\nsimpleFileAccess = CreateUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)\r\nIf simpleFileAccess.exists(saveFilePath) Then\r\n    simpleFileAccess.kill(saveFilePath)\r\nEnd If\r\nDim textOutputStream As Object\r\ntextOutputStream = CreateUnoService(&quot;com.sun.star.io.TextOutputStream&quot;)\r\nDim outputStream As Object\r\noutputStream = simpleFileAccess.openFileWrite(saveFilePath)\r\ntextOutputStream.setOutputStream(outputStream)\r\ntextOutputStream.setEncoding(&quot;UTF-8&quot;)\r\nFor Each line In lines\r\n    textOutputStream.writeString(line)\r\n    textOutputStream.writeString(Chr(10))\r\nNext line\r\ntextOutputStream.closeOutput()\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Dim saveFilePath As String saveFilePath = &quot;\/tmp\/test.txt&quot; Dim lines as Object lines = New Collection [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-2526","post","type-post","status-publish","format-standard","hentry","category-libreoffice-calc"],"views":1017,"_links":{"self":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/2526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2526"}],"version-history":[{"count":4,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/2526\/revisions"}],"predecessor-version":[{"id":2542,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/2526\/revisions\/2542"}],"wp:attachment":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}