Description: 予想される動作としてmyTextFile.writeString("")を実行すればファイルの中身が削除されると思うのですが同じ座標の文字を置き換えるだけです。 Steps to Reproduce: sub test() mySf = createUnoService("com.sun.star.ucb.SimpleFileAccess") myTextFile = createUnoService("com.sun.star.io.TextOutputStream") myFileStream = mySf.openFileWrite("c:\test\test.csv") myTextFile.OutputStream = myFileStream myTextFile.Encoding = "UTF-8" myTextFile.writeString("a") myTextFile.closeOutput() end sub 既に何らかのデータが入ったファイルに対して上記の関数を実行する Actual Results: bbbというファイルがabbに書き換えられる Expected Results: bbbというファイルがaに書き換わる Reproducible: Always User Profile Reset: No Additional Info: If mySf.exists("c:\test\test.csv") Then mySf.kill("c:\test\test.csv") End If 一度ファイルを削除してから上書きすることで回避している
Created attachment 195383 [details] archive of CSV + ODS containing macro OOo 3.3 behaved the same way. I'm not sure I understand the use case. You want to overwrite the whole file, so why not use a different method that first empties its contents, or you workaround that deletes the file and creates a new one?
返信ありがとうございます。 一応現在はmySf.kill("c:\test\test.csv")を使うことで一度ファイルを削除してからファイルの作成を通じて上書きしています