Tag: openoffice writer

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#将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. 我需要插入“新创建的文本文档中的第一行 ” 有解决方案吗