在 VB.NET 中使用 OpenOffice 对单元格进行简单格式化

Simple formatting of cells with OpenOffice in VB.NET

我想在 VB.NET 中自动化 OpenOffice。我已经安装了 "Libre Office"。如何添加对 com 对象的引用?我在 com 对象列表中找不到它。

我可以用值填充单元格。

... 
firstSheet.getCellRangeByName("B10").value = 12.36    
firstSheet.getCellRangeByName("C10").string = "aaaaaa"

但是我不能用单元格做一些简单的格式化。

我想改变单元格的外观。更改'BackColor'或'Forecolor'或'Font size'、'Font Name'、四舍五入等
如何将单元格格式化为日期?如何制作自己的格式样式?如何格式化单元格?

看看 Bernard Marcelly 的 VB.NET OOo guide。文档摘录:

COM interfaces are not visible from the VB programmer. In fact interfaces are seen as objects with methods and properties, and you handle Apache OpenOffice objects as Object.

要设置单元格属性,请参阅 Andrew Pitonyak's Macro document 的第 6.3 节。