adding new lines of text in javascript output S’abonner

0
Avatar
Tom Viguurs

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?

2 commentaires

0
Avatar
mari zeng
Actions pour les commentaires Permalien

Sorry to revive an old thread but did you ever find a solution to this? i am having the same problem.

0
Avatar
Tom Viguurs
Actions pour les commentaires Permalien

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

Vous devez vous connecter pour laisser un commentaire.