using System; using unoidl.com.sun.star.lang; using unoidl.com.sun.star.uno; using unoidl.com.sun.star.frame; using unoidl.com.sun.star.beans; using unoidl.com.sun.star.text; namespace main { class Program { static void Main(string[] args) { XComponentContext context = uno.util.Bootstrap.bootstrap(); XMultiComponentFactory serviceManager = (XMultiComponentFactory)context.getServiceManager(); Object desktop = serviceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context); XComponentLoader componentLoader = (XComponentLoader)desktop; PropertyValue[] loadProps = new PropertyValue[1]; loadProps[0] = new PropertyValue(); loadProps[0].Value = new uno.Any(true); XComponent document = componentLoader.loadComponentFromURL("private:factory/swriter", "_blank", 0, loadProps); XTextDocument textDocument = (XTextDocument)document; XText text = textDocument.getText(); text.setString("Hello World!"); } } }