[Solved] Integration of LibreOffice with WPF

Discussions about using 3rd party extension with OpenOffice.org

[Solved] Integration of LibreOffice with WPF

Postby shinnguyen5589 » Tue Feb 25, 2014 9:57 am

I want to build an app, using Libreoffice api to open office documents(word, excel, powerpoint) in the same application window, writen by C#.
Can you give me some suggestions?
Thanks.
Last edited by shinnguyen5589 on Thu Feb 27, 2014 8:40 am, edited 2 times in total.
OpenOffice 3.1 on Windows 7
shinnguyen5589
 
Posts: 3
Joined: Tue Feb 25, 2014 9:46 am

Re: Integration of LibreOffice with WPF

Postby Villeroy » Tue Feb 25, 2014 11:58 am

OpenOffice documents have nothing to do with Word, Excel nor Powerpoint. Nobody here knows what WTF C# means.
OpenOffice can attach all types of supported documents (including some foreign ones) to its own window tool set.
AWT_Toolset.png
Button, new presentation and spreadsheet in one window

http://www.oooforum.org/forum/viewtopic.phtml?p=36664
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27111
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Integration of LibreOffice with WPF

Postby RoryOF » Tue Feb 25, 2014 12:03 pm

For information: WPF seems to stand for Windows Presentation Foundation (WPF), which links to Visual C#.

Google is your friend: start with
How to: Create a C# WPF Application
Apache OpenOffice 4.1.6 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29473
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Integration of LibreOffice with WPF

Postby shinnguyen5589 » Tue Feb 25, 2014 12:32 pm

I built an C# WPF application, this app using Libreoffice api to open office documents. But documents always open in another window. My expectation is open documents in the same window with main app.
Can you give me some suggestions?
Thanks.
OpenOffice 3.1 on Windows 7
shinnguyen5589
 
Posts: 3
Joined: Tue Feb 25, 2014 9:46 am

Re: Integration of LibreOffice with WPF

Postby Villeroy » Tue Feb 25, 2014 12:39 pm

Can you do that trick with some typical Windows application?
If it has to be OpenOffcie or LibreOffice, I have suggested a working solution.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27111
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Integration of LibreOffice with WPF

Postby shinnguyen5589 » Wed Feb 26, 2014 3:35 am

Hi Villeroy, I don't know exactly what you mean.
This is code I use to open document

//Get a ComponentContext
unoidl.com.sun.star.uno.XComponentContext xLocalContext =
uno.util.Bootstrap.bootstrap();
//Get MultiServiceFactory
unoidl.com.sun.star.lang.XMultiServiceFactory xRemoteFactory =
(unoidl.com.sun.star.lang.XMultiServiceFactory)xLocalContext.getServiceManager();
//Get a ComponentLoader
unoidl.com.sun.star.frame.XComponentLoader xLoader = (unoidl.com.sun.star.frame.XComponentLoader)xRemoteFactory.createInstance("com.sun.star.frame.Desktop");

//Open document
unoidl.com.sun.star.beans.PropertyValue[] Args = new unoidl.com.sun.star.beans.PropertyValue[1];
XComponent xComponent = xLoader.loadComponentFromURL(@"file:///C:/Users/Documents/demo.odt", "_blank", 0, Args);
OpenOffice 3.1 on Windows 7
shinnguyen5589
 
Posts: 3
Joined: Tue Feb 25, 2014 9:46 am

Re: [Solved] Integration of LibreOffice with WPF

Postby gabrielel » Mon Sep 29, 2014 4:24 pm

Hi! I have your same problem. Can you help me? I want to open office file in a user control WPF C#.
Thanks a lot
Gabriele


shinnguyen5589 wrote:I want to build an app, using Libreoffice api to open office documents(word, excel, powerpoint) in the same application window, writen by C#.
Can you give me some suggestions?
Thanks.
OpenOffice 3.1 Windows Vista
gabrielel
 
Posts: 2
Joined: Mon Sep 29, 2014 4:21 pm


Return to Extensions

Who is online

Users browsing this forum: No registered users and 1 guest