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

On 1/4/07, Christian Lippka <[EMAIL PROTECTED]> wrote:

Yes, get the current XController from the XModel and use the
XSelectionSupplier interface on it. This either returns a single
XShape reference or a sequence of XShape for multi selections.

Regards,
Christian

Madhan Ponnusamy wrote:
> Hi,
> i had inserted many shapes inside impress document using XShapes and
xShape
> interfaces....but now i need to get the currently selected
> shape from the document..is that possible?
>

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


Reply via email to