company logo

MS Office document generation

A typical way for generating MS Office documents is using MS Word macro features. The Terminus application provides document generation actions, which may work, however, only when the required document templates have been installed. Document templates are not part of the ODABA installation and might be modified or rewritten according to specific requirements.

Typically, MS Office document templates refer to an initial document, which provides style definitions and title page for the document to be generated. This might easily be replaced by a more appropriate one. Moreover, styles might be changed, but not the style names, which are referred to from within the macros. Available macros and its resources are described below.

In order to support scripting languages as MS VB Script, ODABA .Net libraries have to be extended by a wrapper library. The .Net project and other resources required for MS document generation are available at following locations:

  • MS Word helper functions

http://www.odaba.com/content/downloads/demos/odabaWordHelper.zip

  • Document template

http://www.odaba.com/content/downlads/demos/DocumentTemplates.zip )

Those are just demos for showing, how to get out some documents from an ODABA database. On the other hand, these demos are used by RUN for generating documentation from Terminus specifications. Usually, document templates are installed in the template directory ( /usr/share/odaba/template under Linux and ... odaba/template under MS Windows).

Document templates are provided as .dot files for reference documentation ( ReferenceDocu.dot ), Terminology Model documentation ( TerminologyModel.dot ) and hierarchical topic documentation ( TopicsDocu.dot ). Document style definitions are provided for these templates in .doc files with appropriate names.

Notes:

MS Office document generation by means of VB Script macros is one possible way, but it is rather slow and difficult to maintain. A better way is using Open Document templates, which generate documents that are accessible in MS Office as well as in LibreOffice.

MS Word helper functions

The MS Developer Studio 2010 solution provides an ODABA wrapper supporting ODABA database access and a few MS Word function for opening and closing word documents. Before compiling the solution, references for odaba-net.dll and dotnet-connector.dll have to be updated.

The wrapper library works with all MS Office versions from office 1997-2003 upwards. It has not been tested with older versions.

When opening a document ( ODocument ::Open() ), an ini-file is required, that contains document and template name. The ini-file is, usually, generated when calling MS Word macros from within Terminus . Otherwise, an ini-file has to be provided, which contains a path the document to be created (option name passed in docname ) and a path for a template for initializing the document (option name passed in templatename ).

Two more functions ( ODocument ::Find() and ODocument ::ReplaceText() ) are available for convenience.

The odabaDBInterface file provides the ODABA database access function wrapper for accessing the database ( ODatabase ), for property handle support ( OProperty ) and for value access ( OValue ).