Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I want to copy text from one Open-Office Writer i.e. .odt file to another odt file's textframe. I am not getting any correct method to do the same. I am very much familiar to do the same with Microsoft Interope assembly, but not getting it in Open Office.

Any help for the same please?????

I got copyText method in XAccessibleText interface. But I don't know how do I get access to this method. Whats I had tried to cast this
Quote:
unoidl.com.sun.star.accessibility.XAccessibleText
object to TextFrame or component.

The same case is happening while using the interface
Quote:
XAccessibleEditableText
where I can get pasteText method.

Fyi, this is my snippet...

XAccessibleText objTextAccess = (XAccessibleText)xNamedTextFrame;
long myCharCount = objTextAccess.getCharacterCount();
bool test = objTextAccess.copyText(0, Convert.ToInt32(myCharCount));
Console.WriteLine("Status: ", test);


And I am getting error as
Quote:
Unable to cast transparent proxy to type 'unoidl.com.sun.star.accessibility.XAccessibleText'.


Please If anyone can guide me. Any small snippet of the implementation with c# will do for me. Need any hint..

Thanks
Posted
Updated 18-Nov-13 19:23pm
v2
Comments
ZurdoDev 15-Nov-13 7:41am    
Since it is "Open" office I would imagine there is documentation on how to program with it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900