Adding data by software, Basics – Kofax DOKuStar Validation User Manual

Page 24

Advertising
background image

DOKuStar Validation Programming Manual

Page

20

Adding Data by Software

Basics

Usually, the data will reside somewhere in your system and will be imported into DOKuStar Validation by software.

The following example first loads the project that we created above, and then fills the data with two documents:

Private Sub Form_Load()
Dim MyApp As New DOKuStarValidation.Application '* declare validation part of
DOKuStarValidation

'* make sure no project is open
If Not MyApp.Project Is Nothing Then
MyApp.Project.Close
End If
'* load the Project and fill with data
MyApp.LoadProject App.Path + "\MyProject.vpj"
FillData MyApp.Project.DataSet.Data
MyApp.Visible = True
Unload Me
End Sub

Private Sub FillData(MyData As DOKuStarDataSet.Data)
Dim doc As Document
Dim subdoc As Document

'* add a document
Set doc = MyData.Documents.Add("Letter")
doc.Fields("Sender").Value = "Océ Document Technologies"
Set subdoc = doc.Documents.Add("CoveringLetter")
Set subdoc = doc.Documents.Add("Invoice")
subdoc.Fields("TotalAmount").Value = "100.00"

'* add another document
Set doc = MyData.Documents.Add("Letter")
doc.Fields("Sender").Value = "Océ Document Technologies"
Set subdoc = doc.Documents.Add("CoveringLetter")
Set subdoc = doc.Documents.Add("Invoice")
subdoc.Fields("TotalAmount").Value = "200.00"
subdoc.Fields("InvoiceDate").Value = "2.2.2002"
Set subdoc = doc.Documents.Add("Voucher")
subdoc.Fields("VoucherDate").Value = "31.01.2003"
End Sub

When you run this code, DOKuStar Validation will start and display the two documents:

Advertising