Categories > OpenTBS with ODT >

Sending OpenTBS variables to a OOo writer macro?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Vincent
Date: 2010-01-13
Time: 16:31

Sending OpenTBS variables to a OOo writer macro?

Hello,

Just wondering if it is possible to send some variables directly to a certain macro inside the new document.

If not: what is the best way to accomplish this? Sending the variable to a textfield and then writing the macro to get the value of that specific textfield?
By: Skrol29
Date: 2010-06-21
Time: 13:59

Re: Sending OpenTBS variables to a OOo writer macro?

Hi,

Did you found the solution?
By: Vincent
Date: 2010-06-21
Time: 15:45

Re: Sending OpenTBS variables to a OOo writer macro?

No(t yet).

Since asking the question, I have re-arranged my priorities. In the next two months I plan to cover the same grounds, so I'll let you know if I find the answer.
By: Skrol29
Date: 2010-06-21
Time: 16:16

Re: Sending OpenTBS variables to a OOo writer macro?

Yes you can merge data in the OpenOffice macros.

You first need the load the subfile corresponding to the module where the macro is saved, then automatic fields and blocks (onload, onshow, var) will be taken in account. And then you can perform your manual merging (MergeBlock or MergeFiled).

Example:
$TBS->LoadTemplate("my_example.odt"); // load the OpenOffice document
...
$TBS->LoadTemplate("#Basic/Standard/Module1.xml"); // load the module, onshow fields are automatically merged at this point
$TBS->MergeBlock(...); // if needed
$TBS->MergeField(...); // if needed

You will just need to be careful about the string conversions between your data and the module. You may need to use parameter "htmlconv" if you encounter issues.