Have you checked the type within the Any:

Type t = Any.Type;

If it is XPropertySet type, then there seems to be bug. Could you then provide a stripped down (but still buildable) example that lets me reproduce this problem?

BTW, I assume you are NOT using the assemblies which were once provided through the udk.openoffice.org website. Instead one needs to use the cli-uno bridge and assemblies which are automatically installed with OOo2.

Joachim


Florian Limberger wrote:
Hi,

I'm using C# with cli-uno to control OO. I want to set the column-property "OptimalWidth" of a TextTable to true.

Casting the column to a XPropertySet does not work (invalid cast). Does anyone know, how to set the OptimalWidth of a whole TextTable ?

cheers
Flo

----------------------------------------------------------------
XTextTable table = null;
XMultiServiceFactory factory = (XMultiServiceFactory)doc;

table = (XTextTable) factory.createInstance("com.sun.star.text.TextTable");

XTableColumns cols = table.getColumns();

int count = cols.getCount();

for(int i=0;i<cols.getCount();i++)
{
  XPropertySet props = (XPropertySet)cols.getByIndex(i).Value;
  props.setPropertyValue("OptimalWidth",new uno.Any(true));
}
----------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to