

Create a new blank writer document using our component (XComponentLoader) multiServiceFactory.createInstance( so that we could load or create new documents. Notice: We cast our desktop object to XComponent loader Create a new Desktop instance using our service manager lang.XMultiServiceFactory multiServiceFactory = we need this to get a desktop object and create new CLI Get a new service manager of the MultiServiceFactory type start it and then return the ComponentContext. If OpenOffice isn't already started this will Call the bootstrap method to get a new ComponentContext Private static string FileName = void Main( string args) * Add all needed CLI namespaces to the current class. It isn't really long and I will place self speaking comments inside the code.
#Openoffice ac code
I think the best way is, if I will show you the whole source code of this application. In this blank document we write some simple text and at least the document should be saved. If we receive the desktop instance we will start a blank text document. If the application is connected we create a service handler to communicate with OpenOffice and use it to get access to the OpenOffice desktop. A first applicationĪs first application we would programming a simple application which connect to an running OpenOffice instance and if OpenOffice isn't already running it will start a new instance. Now, you are ready to write your first application. Your Solution Explorer window should look similar the next screen shot:

At least click OK in the “Reference” window to add the CLI assemblies to your references. Select all CLI assemblies and choose “Open”. In the appearing “Reference” window choose “Search” and navigate to your “Resources” folder. Right click “References” and choose “Add references”. Now, you are ready to referncethe CLI assemblies within your project.If you don't see it you have to turn on show all files and directories. Switch back to your Visual Studio window and in the Solution Explorer right click on the folder new folder “Resources”. Inside your project directory you create a new folder and name it “Resources”. net assemblies.ĬLI assemblies: cli_basetypes.dll, cli_cppuhelper.dll, cli_types.dll, cli_ure.dllĬopy all assemblies to the clipboard and move back to your project directory. In this folder you should see the following. You will find them in your OpenOffice program installation path in the folder named “assembly”. Change from the Visual Studio window to a Explorer window.This guide will always use C# as programming language. net or C# as your default programming language. It's up to your choice if you use Visual Basic. Open your IDE and start a new “Command line Application”.equal 2.0 and you use Microsoft Visual Studio. Requirements for this next steps are that you have already a installation of a OpenOffice version greater resp. Setting up a first project with Ms Visual Studio. I hope this short guide will show you how you simply develop applications which use OpenOffice. net development below OpenOffice version 2.0 is possible by using the Reflection technology. This is a really advantage against other languages like C++ or Java.Įven. Yes, that is all! There is no need of SDK installation it will run simply by referencing the assemblies. net developer to reference this assemblies and write applications that communicate and interact with OpenOffice. Which are represented by the CLI assemblies which are part of each OpenOffice installation. Since OpenOffice version 2.0 this costs could bedowncast to a minimum, because OpenOffice offer since this version a. If this solutions could changed to accept both Microsoft Office and OpenOffice I think many companies would move! OK, it will cost some development time and so also money to realize this, but it is a one time cost. So why they don't move to OpenOffice? I guess they stuck on Microsoft Office, because they have too many in house IT solutions which need Microsoft Office to run. The Gui handling since OpenOffice 2.0 is very similar to Microsoft Office. I think many IT decision maker of companies think about moving from Microsoft Office to OpenOffice, because they could save a lot of money and since OpenOffice version 2.0 there isn't really a need for a employee training. So you should give it a chance and try it out. The acceptance of OpenOffice is increasing day by day.
#Openoffice ac full
This is one of the reasons why OpenOffice is really stable and full of features, so that you would miss nothing if you move from Microsoft Office to OpenOffice.
#Openoffice ac free
OpenOffice is a free available Office Suite which is based on Suns StarOffice.

net HOME OpenOffice programming with C# /.
