Would anyone be able to help me with what looks like a simple problem that I cannot find an answer for?
I have a mailing process that needs to send a fixed width text file to a mailer inserter as a control file for the inserter. I am trying to use a vbscript that does this but I would like to use the $(document.sequence.job) variable that gets used in the barcode on the printed piece but I do not know how to call it in vbscript. the script I am using is below which is failing on the jobSequence variable.
All variables using the metadata work fine its just the document sequence I need.
I would appreciate any help on this. Thanks
Option Explicit
Dim MyMeta, x, MyCSVLine, FSO, ft, Filename, jobSequence
Set MyMeta = CreateObject("MetaDataLib.MetaFile")
MyMeta.LoadFromFile(Watch.GetMetadataFileName())
Filename = MyMeta.Job.Group(0).Document(0).FieldByName("_vger_fld_JobID")
jobSequence = ${document.sequence.job}
'create CSV
Set FSO = CreateObject("Scripting.FileSystemObject")
Set ft = FSO.OpenTextFile("\\filepath\output\0000"+Filename+".jaf",2,True)
ft.WriteLine("H0000"+Filename)
'for all documents in group 0
For x = 1 to MyMeta.Job.Group(0).Count
'add new CSV line
MyCSVLine = "B" + Right(String(10,"0")& MyMeta.Job.Group(0).Document(x-1).FieldByName("_vger_fld_JobID"),10) +_
Right(String(10,"0")& jobSequence,10) +_
Left(MyMeta.Job.Group(0).Document(x-1).FieldByName("_vger_fld_sft_MailmarkSeq")& Space(8),8) +_
Left(MyMeta.Job.Group(0).Document(x-1).FieldByName("_vger_fld_LetterType")& Space(30),30) +_
Left(MyMeta.Job.Group(0).Document(x-1).FieldByName("_vger_fld_OrigName") & Space(112),112)
ft.WriteLine(MyCSVLine)
Next
ft.Close
Set FSO = Nothing
Set MyMeta = Nothing