2009-10-20 152 views

回答

0

您必须通过XPropertySet接口访问表。您可以通过铸造表的XPropertSet做到这一点:

// Example 
XPropertySet tablePropSet = (XPropertySet)textTable; 

// This is how you set a property in C# 
// You have to create a new Any object to pass it as parameter 
tablePropSet.setPropertyValue("HeaderRowCount", new Any(typeof(int), 1)); 

的“任何”的对象是在“UNO”命名空间(未unoidl.com.sun.star.uno)。您并不需要这么做

typeof(int) 

除非该类型不是基本类型。

new Any(1) 

适用于基本类型。

BREAK请例如:

XPropertySet tablePropertySet = (XPropertySet)table; 
tablePropertySet.setPropertyValue 
    ("BreakType", new Any(typeof(BreakType), BreakType.PAGE_BEFORE));