Hi there,

Thanks for your reply, i had created the code as u told...but it is showing
null pointer exception..the code is

public void callPlayer(XScriptContext xSc) {
       String name="";
       XComponent xComponent = xSc.getDocument();

XModel xModel = (XModel) UnoRuntime.queryInterface (XModel.class,
xComponent);
       XController xController = xModel.getCurrentController();
       XSelectionSupplier xSelection = (XSelectionSupplier)
UnoRuntime.queryInterface(XSelectionSupplier.class,xController);
       Object temp =  xSelection.getSelection();
       XShape getShape = (XShape)
UnoRuntime.queryInterface(XShape.class,temp);

       XPropertySet xShpProp = (XPropertySet)
UnoRuntime.queryInterface (XPropertySet.class,
getShape);
       try {
          name = xShpProp.getPropertyValue("Name").toString();
       } catch (UnknownPropertyException ex) {
           ex.printStackTrace();
       } catch (WrappedTargetException ex) {
           ex.printStackTrace();
       }
   }
i had inserted a image in impress and runned this macro it is showing error
Type: NullPointer Exception..whats wrong?is the selectionsupplier not
getting the shape

the method getSelection returns a ShapesCollection. Therefore you could query this to css.container.XIndexAccess and then make use of the method getByIndex() to get your shape.

Hope that helps

Regards

Stephan

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

Reply via email to