...
- Template.rtf is the name of the RTF template file created by MS Word. The following does apply:
- It is necessary to include the ".rtf" extension;
- The file should be stored on the current Applications directory;
- The RTF document should be checked by Quaestor on any impropper RTF code. Do this through the menu item Tools>RTF Template Check...
- Target$ is a string expression containing the name of the document to be created (use for instance the TIME() and ORCA() functions for the generation of this name).
- Mode% are Mode% are options:
- Mode% Mode% = 0: do NOT start MS Word to show the resulting document;
- Mode% Mode% = 1: start MS Word with the resulting document;
- Mode% Mode% = 2: do NOT start MS Word and leave document as .rtf;
- InpVar is an optional list of parameters used in Template.rtf. While creating the expression, the parser will search the template for any parameters and include these in the expression automatically. Any parameters that are not automatically traced by the expression parser should be included because the parameters in the template will not be determined on evaluation of the expression unless they are in the expression itself.
...
- Although the document can only be saved as .doc if MS Word is installed. MS Word is not necessary to carry out some of the basic template functionality as this is done on a Rich Text Document format. However, when Word automation is required (in case of creating tables using the TELITAB2WORD$() function, or building a document based on several separate documents or Word macro's), MS Word will be required.
- To use all the advantages of the MS Word integration, the use of VBA code should be allowed (can be found in the security settings).
- On some systems unsolvable MS Word errors may occur resulting into an unfortunate Quaestor error. When this is the case, please select mode%=2 and open the document separately.
- In multi-case solutions, MS Word is not started per case, even if Mode%=1.
- Please note that WINWORD$ only works with RTF documents and not with .DOC, .TXT, etc.
- Target$ should not contain any path information, the output file is ALWAYS written to the current Report directory. If path information is included in Target$, it is removed. Preferably, do not use the name of your template as Target$.
- The WINWORD$ function returns the file name being the value of Target$. In the event of multi case document generation, "_" + CaseNr% is added automatically, e.g. DataFax_4.doc for the 4th case unless you have controled this multi case dependency yourself by adding "_"+ORCA(1) to your expression.
- The simplest way to create a template file is by means of MS Word and save the document as rtf.
- On any location where you want to insert values computed by Quaestor in the template, it should be indicated using format statements between "#". See the TEMPLATE$() function for options.
...
To generate a document, double click on the parameter connected to the expression to start the dialogue. Quaestor will either ask for values of the above parameters or calculate them (if possible). If the WINWORD$ function is invoked and finished, with the Mode% being 1, MS Word will open with the resulting document. This document is a normal Word document as any one created within Word itself. Note that the resulting document starts as a RTF document which will be saved as .DOC in Word, resulting in a considerable reduction of file size. Reports created by WINWORD$ can be of enormous size if, for instance graphical information is included. The original created document remains on the current Report directory.
...