[Solved] C# How to create table in Writer

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
Ex_Soft
Posts: 5
Joined: Thu Jul 22, 2010 8:05 pm

[Solved] C# How to create table in Writer

Post by Ex_Soft »

Code: Select all

object
  Table=ServiceManager.GetType().InvokeMember("createInstance",BindingFlags.InvokeMethod,null,ServiceManager,new object[]{"com.sun.star.text.TextTable"});
||

Code: Select all

XTextTable
  Table=(XTextTable)ServiceManager.createInstance("com.sun.star.text.TextTable");
Table is null.
Last edited by Ex_Soft on Fri Jul 23, 2010 4:26 pm, edited 1 time in total.
OpenOffice 3.2 on FC13 / OpenOffice 3.2 on Windows XP
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: C# How to create table in Writer

Post by hanya »

Work with com.sun.star.lang.XMultiServiceFactory interface of the document.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Ex_Soft
Posts: 5
Joined: Thu Jul 22, 2010 8:05 pm

[Solved] C# How to create table in Writer

Post by Ex_Soft »

THNX

Code: Select all

object
  Table=Document.GetType().InvokeMember("createInstance",BindingFlags.InvokeMethod,null,Document,new object[]{"com.sun.star.text.TextTable"});
||

Code: Select all

XTextTable
  Table=(XTextTable)((XMultiServiceFactory)Document).createInstance("com.sun.star.text.TextTable");
works fine.
OpenOffice 3.2 on FC13 / OpenOffice 3.2 on Windows XP
Post Reply