Hi,

this is documented in the API documentation. If you look at the service TextEmbeddedObject you can see that the properties Model and Component are defined as maybevoid. This is due to the fact that not all embedded objects have a model/component. AFAIK a Formula is only represented by a property set.

You could determine the type of embedded object using the CLSID property.

regards
Sascha

Makaray schrieb:
Hi,
i have problem with embedded object. I'm using XTextEmbeddedObjectsSupplier in writter 
document, to get access to this object. This object give me a list of all embedded 
elements in document. Property "Model" should give me a XComponent object, but 
sometimes it's null value. Does anybody know why ??
My code:
XTextEmbeddedObjectsSupplier xEmbeddedObjectsSupplier = 
(XTextEmbeddedObjectsSupplier) UnoRuntime
            .queryInterface(XTextEmbeddedObjectsSupplier.class,
                  xTextDocument);
String[] names = xEmbeddedObjectsSupplier.getEmbeddedObjects()
            .getElementNames();
for (int i = 0; i < names.length; i++) {
      Object o = xEmbeddedObjectsSupplier.getEmbeddedObjects()
                  .getByName(names[i]);
      XPropertySet xPropSet = (XPropertySet) UnoRuntime
                  .queryInterface(XPropertySet.class, o);
          XComponent XComponent = (XComponent) UnoRuntime
                     .queryInterface(XComponent.class, xPropSet
                           .getPropertyValue("Model"));
                 }

I think, the problem is with documents created under Ms Office.How to solve it??


----------------------------------------------------------------------
Graj za darmo! Wejdz do swiata wojny wampirow!
Kliknij >>> http://link.interia.pl/f1c8a

---------------------------------------------------------------------
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