Home   Download  |  Software  |  Templates  |  Tour  |  Partners  |  About Us  |  Help

 

Building Integrated Solutions

Previous | Topics | Next

VB Example

This is a simple example. The code is linked to a command button. The AnswerFile, Answers & Template are all hard coded. There is no error checking. It is meant as an overview guide only.

 

Dim oInforms as clsInforms

Dim Answer as Integer

 

'Assign a reference to our object variable

Set oInforms = New clsInforms

 

'Open the required Answer File - Can be new file

oInforms.OpenAnswerFile "c:\informs\data\answers\Matter999"

   

'Write required answers to Answer File

oInforms.WriteAnswer "Name", "William Smith"

oInforms.WriteAnswer "Company", "XYZ Corp"

 

'Save and close the AnswerFile

oInforms.CloseAnswerFile "c:\informs\data\answers\Matter999"

 

'Open the required Template and pass the AnswerFile to it

oInforms.NewDoc "c:\Templates\Agreement.doc", "c:\informs\data\answers\Matter999"

 

'Hide this App to give Word focus and start the Assembly

Me.Hide

oInforms.APIAssemble

 

'Open the Answer File and read through the Answers

oInforms.OpenAnswerFile "c:\informs\data\answers\Matter999"

For Answer = 1 To oInforms.AnswerNumber

      'Save necessary answers back to your own database if required

       MsgBox oInforms.AnswerName(Answer) & " - " & _  

                Informs.AnswerValue(Answer)

Next

 

'Give this App the focus when Assembly has finished

Me.Show vbModal

Previous | Topics | Next

 

Copyright © 2006 - Inform Solutions Pty Ltd