Do you have any ideas?
I tried to add "+ CHARCR" to make the next book component to appear on the next line, but that did not help.
Thanks for your input in advance!
Hi Roman, This works for me:
Set sPath = 'C:\DATA\Test.txt';
New TextFile File(sPath) NewVar(oFile);
Set oBook = ActiveBook;
Loop ForEach(BookComponent) In(oBook) LoopVar(oBookComp)
Write Object(oFile) oBookComp.Name;
Close TextFile Object(oFile);
You have to close the text file when you are done with it. Maybe that is the problem with your code.
Thank you for your response and for the suggestion!
I found the problem -- I put the file creation function inside the loop...
Your example helped me understand what the problem is.
By the way, I do not add any instruction to open the created text file, so why do I need to close it?
Thank you again!
Hi Roman, When you create a new text file with the New TextFile command, it opens it automatically for writing. So to be safe, you should explicitly close it. -Rick
By saying "opens it automatically for writing" you mean that the file becomes writable and not that the text file is opened in the default text editor after creating it, correct? I guess, by running the Close() function, you just save the latest changes.