Manage your legal forms via the Cloud. Easy to complete, save, share, submit. Version 10 now available.

Occasional Forms User?

Oyez also offer a large selection of forms in paper or PDF format. Purchase direct from:
www.oyezstore.co.uk

Featured Oyez Products

 

Minimise risk and comply with SRA regulations.

Word-based Security Policies

Online Risk Assessments

Emailed Newsletters

Guides/Consultancy

www.oyezsecurity.co.uk

 


Follow Us

Twitter

 

HOME SEARCH SITE CONTACT US PRIVACY CORPORATE NEWS ACCOUNT LOGIN

Support Home

Search

Call 08450 17 55 17, option 2     email: support@oyez.co.uk

Example automation code - C# Dotnet

See also:

  • You can download a working c# project here
  • A documented list of available commands can be viewed here


// This example uses the ocx control. You may also use interopservices to launch OyezForms.
//
In the form's design view, right-click in the 'General' area of the Toolbox panel and select 'Choose Items...'
// In the 'Choose Toolbox Items' dialog, select the 'COM Components' tab
// Scroll down the list of components and put a tick next to 'OyezV8EZ', then click 'OK'.
// The ocx will appear on the Toolbar. Double-click on it to add it to the form.

axOyezV8EZ1.createserver(); // create OyezForms application server
Boolean b = axOyezV8EZ1.NewForm("DIV_E");

axOyezV8EZ1.maximise(); //always maximise as a first act to ensure current instances are found

//Retrieve an array of field labels in the form
//(for presenting mapping options to users)

for(int x=1; x<=axOyezV8EZ1.Pages; x++)
{
axOyezV8EZ1.Page = x;
string[] Lbllst = axOyezV8EZ1.labellist().Split(',');
     foreach (string Lbl in Lbllst)
     {
     }
}
axOyezV8EZ1.Page = 1;  //select first page again

// field labels are the recommended route for filling values into forms
// they are stable, both across form revisions, and across forms within a range.

axOyezV8EZ1.fill("Petitioner", "Mrs Divor");
axOyezV8EZ1.fill("Respondent", "Mr Divor");

// field IDs can also be used for data filling, but these change between form revisions
// you should provide a mapping interface to them for compatibility with a small number of older forms

string[] Idlst = axOyezV8EZ1.FieldList.Split(',');
axOyezV8EZ1.fillfield(6, "12345-789");

//save the form to a path
axOyezV8EZ1.store(@"c:\temp\test.olf");

//read path to OyezFrms.exe
//this is useful for locating the \library\mastlibr.mdb file that contains details
//of all available form templates - see documention

string progpath = axOyezV8EZ1.executablepath();

//You can print to a targetted printer programmatically
// name, tray, duplex (due to printer variance, duplex cannot be guaranteed)
//all pages will print
//see commands documentation for return values

axOyezV8EZ1.finishfilling(0); //Guarantee update of display prior to printing.
long pres = axOyezV8EZ1.targetprint("HP LaserJet 1020", 2, 0);

//or print to the current program default printer
//OyezForms will select a printer in this order:
//1. set in Tools > Options > Print: 'Initial Printer'
//2. System default
//you can specify ranges of pages, this example prints all.

axOyezV8EZ1.finishfilling(0); //Guarantee update of display prior to printing.
axOyezV8EZ1.print(1, axOyezV8EZ1.Pages);

//export form to a flattened PDF
//and allow processing to complete before next action

//see command documentation for return values
axOyezV8EZ1.finishfilling(0); //Guarantee update of display prior to export.
long PDFres = axOyezV8EZ1.exporttoPDF(@"c:\temp\out.pdf");
while (axOyezV8EZ1.ActionsComplete() != true)
{
System.Windows.Forms.Application.DoEvents();
}

//close form
axOyezV8EZ1.discard();
//exit application server
axOyezV8EZ1.exit();

}