I'm working on some code to paste into the currently active OpenOffice document directly from C#. I can't include any of the OpenOffice libraries, because we don't want to package them, so we're using reflection to get access to the OpenOffice API.
My question involves using a dispatcher through reflection. I can't figure out the correct parameters to pass to it, giving me a lovely "TargetInvocationException" due to mismatched types.
object objframe = GetProperty<object>(objcontroller, "frame");
if (objframe != null)
{
object[] paramlist = new object[2] {".uno:Paste", objframe};
InvokeMethod<object>(objdispatcher, "executeDispatch", paramlist);
}
How can I fix it?