Executing LO Basic Macro during Rendering (for Formatting Text)

Asked by Al

Hi,

I'm using POD to generate documents with dynamic contents. However, one of the contents needs dynamic formatting.

For example, in the string 'creative force' I want to bold the word 'creative' but not 'force'.

So, if I can code something like this it would be great.

>> from appy.pod.renderer import Renderer
>> commercial = '<b>creative</b> force'
>> renderer = Renderer('SimpleTest.odt', globals(), 'result.odt')
>> renderer.run()

But I understand that this is not supported.

So what I am trying now is to use basic macro. The macro basically will just search for the word 'creative' and then bold it. I then attached it to the event 'Save Document As' hoping that when the renderer creates the output the macro will also run. But it seems it does not trigger the macro.

So any suggestion on how I can do this?

Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
Appy Edit question
Assignee:
No assignee Edit question
Solved by:
Al
Solved:
Last query:
Last reply:
Revision history for this message
Al (alpotr) said :
#1

Ok, got it

I just need to create a python script in the odt that says something like this:

do text
from xhtml(commercial)

and then in the program I just need to do this:

>> from appy.pod.renderer import Renderer
>> commercial = '<b>creative</b> force'
>> renderer = Renderer('SimpleTest.odt', globals(), 'result.odt')
>> renderer.run()