Tag: uno

OpenOffice with .NET:如何遍历所有段落并阅读文本

如何遍历OpenOffice Writer文档中的所有段落并输出文本。 我有Java示例,但不知道如何将代码转换为C#。 Java示例可以在这里找到: http : //wiki.services.openoffice.org/wiki/API/Samples/Java/Writer/TextDocumentStructure 我的C#代码: InitOpenOfficeEnvironment(); XMultiServiceFactory multiServiceFactory = connect(); XComponentLoader componentLoader = XComponentLoader)multiServiceFactory.createInstance(“com.sun.star.frame.Desktop”); //set the property PropertyValue[] propertyValue = new PropertyValue[1]; PropertyValue aProperty = new PropertyValue(); aProperty.Name = “Hidden”; aProperty.Value = new uno.Any(false); propertyValue[0] = aProperty; XComponent xComponent = componentLoader.loadComponentFromURL( @”file:///C:/code/test3.doc”, “_blank”, 0, propertyValue); XEnumerationAccess xEnumerationAccess = (XEnumerationAccess)xComponent; XEnumeration xParagraphEnumeration = […]

使用c#以编程方式读取Openoffice Calc(.ods)?

我想知道是否可以使用c#以编程方式读取OpenOffice Calc电子表格,我可以为Excel(.xls和.xlsx)执行此操作,但无法找到读取计算电子表格的解决方案。 如果有人有解决方案,帮助我。

使用C#将html文本插入.odt OpenOffice文档

请帮助在C#中使用OpenOffice Writer文档的任何人。 如何将HTML格式化文本插入到文档中? 以下代码: ((unoidl.com.sun.star.text.XTextDocument)xComponent).getText().getStart(). setString(“The first line in the newly created text document.\n\n”); The first line in the newly created text document.准确插入The first line in the newly created text document. 我需要插入“新创建的文本文档中的第一行 ” 有解决方案吗

如何以编程方式在OpenOffice.org中保存文档?

我想将通过OpenOffice.org UNO创建的TextDocument保存到磁盘上的文件中。 做这个的最好方式是什么? 编辑:这是我最终使用的C#代码。 document是一个XTextDocument 。 protected void Save (string path) { string url = “file://” + path; PropertyValue [] propertyValues = { new PropertyValue { Name = “FilterName”, Value = new Any (“writer8”) } }; ((XStorable) document).storeAsURL (url, propertyValues); }

Bootstrap Uno API LibreOfficeexception

使用以下代码: static void Main() { try { var context = uno.util.Bootstrap.bootstrap(); } catch (Exception ex) { Console.WriteLine(ex.toString()); } } 我可以开始LibreOffice的作家。 这适用于版本4.4.4但在安装版本5.0.0和新SDK后Bootstrap.bootstrap()抛出exception: “External component has thrown an exception” 有没有人遇到同样的问题或一些解决方案? (.NET 4.0,Windows 7 64位,LibreOffice 5.0 Lite)

使用OpenOffice Uno CLI和C#创建电子表格

到目前为止,我已经找到了几个讨论ODS文件创建的来源: 如何在.Net中创建ODS文档以及如何使用C#.NET创建.odt文件? 最有趣的是打开calc文件的解释 。 然而,这会在全屏幕中打开OpenOffice,我正在寻找的是一种写入Calc文件(.ods)而不实际打开Openoffice的方法。 这样我就可以编写一个只打开一个savefiledialog的函数,获取文件名,然后创建并保存.ods文件。 是否有任何C#代码示例可用于执行此类操作?