Hello everyone,
I work on a program that involkes at a stage a shell command. My command that i need to involke is this:
openoffice.org3 "macro:///Standard.Module1.findandreplace" file.doc
or
openoffice.org3 file.doc "macro:///Standard.Module1.findandreplace"
... both are correct, run perfect in terminal and do what they should.
My issue is that inside the c++ program i have something like and no matter what i do is a failure:
Code:
void openofficelaunchwithmacro()
{
QString filename=file.doc;
int code=fork();
if (code == 0)
execl("/usr/bin/openoffice.org3"," \"macro:///Standard.Module1.findandreplace\" " ,qPrintable(filename), 0);
...
}
or
void openofficelaunchwithmacro()
{
QString filename=file.doc;
int code=fork();
if (code == 0)
execl("/usr/bin/openoffice.org3",qPrintable(filename)," \"macro:///Standard.Module1.findandreplace\" ", 0);
...
}
I use Qt 4.7 as devel environment. The reason why I got to this fork()/execl() solution is because i need a code like shoot and forget, meaning i need to start the process and still be able to do what i must in the user interface. If i use system() method instead, the program has to wait until openoffice is closed and like this stalls.
One more thing; does anyone has an idea where can i find libre office writter's macros folder? Couldn't find it with find.
When getting to this part the program does nothing.
Any suggestions?
Thank you.
coss_cat