如何以编程方式在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); } 

使用XStorable.storeToURL() (或storeAsURL)。

编辑:您需要传递具有输出格式的FilterName 。 示例(在Python中,因为它更简单):

 properties = ( PropertyValue('FilterName', 0, 'writer8', 0), ) document.storeToURL('file:///path/to/document.odt', properties)