adding new lines of text in javascript output
Hello, i have a btw document where when printed, a text file is written.
The current script looks like this:
Dim btFormat As BarTender.Format
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("C:\path\"& Product & "_" & LabelType &".txt", True)
a.WriteLine(Product & vbTab & Content & LabelType )
This will create a text file with named data fields in it.
Now im really struggling that i need a text file where these lines are added to it, not a new text file each time the document is printed but i have no clue how to accomplish this. Any ideas?
-
Sorry to revive an old thread but did you ever find a solution to this? i am having the same problem.
0 -
Hello Mari, check out the code below which i use for logging data to a text file. The named datafields 'Product', 'Content' and 'Batch' are written to an excisting text file when in my case the document is printed. (place this file into javascript section On New Record). Good luck!
'Dim btFormat As BarTender.Format
Set fs = CreateObject("Scripting.FileSystemObject")
'open file in append mode (8)
set objLog = fs.OpenTextFile("C:\YOURPATH\filename.txt", 8, true, 0)
'write to file
objLog.WriteLine (Product & vbTab & Content & vbTab & Batch)
'close file
objLog.close
0
Please sign in to leave a comment.
Comments
2 comments