Isn't it funny how documenting a problem leads you to the solution!
I now realize I don't need a definiton of XGraphicObjectShape. It's done
through property sets.
I can create the object and set it's GraphicURL property as follows:

                XShape shape =
(XShape)msf.createInstance("com.sun.star.drawing.GraphicObjectShape");
                XPropertySet xPropSet =
(unoidl.com.sun.star.beans.XPropertySet)shape;
                xPropSet.setPropertyValue("GraphicURL", new
uno.Any(sNewUrl));

Problem solved!



"David Cawley" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> GraphicObjectShape is a service in the module com::sun::star::drawing
> I would expect cli_types.dll to provide a definition of a public interface
> XGraphicObjectShape just as it does for XShape but I can find no such
> definition.
> I can create an instance of GraphicObjectShape using the createInstance
> method of the MultiServiceFactory interface of the document object as in
the
> following C# snippet:
>
>                 XMultiServiceFactory msf = (XMultiServiceFactory)
> mxDocument;
>                 XShape gos = (XShape)
> msf.createInstance("com.sun.star.drawing.GraphicObjectShape");
>
> So, whilst I can create the object, I cannot access its properties or
> methods.
> I need to write code like:
>
>                 XGraphicObjectShape gos =
> msf.createInstance("com.sun.star.drawing.GraphicObjectShape");
>                 gos.GraphicURL = "file:///c:\image.bmp";
>
> But without a definition of XGraphicObjectShape in cli_types.dll I'm
stuck.
>
> "Joachim Lingner" <[EMAIL PROTECTED]> wrote in message
> news:<[EMAIL PROTECTED]>...
> > Dave Cawley wrote:
> > > I've recently started using the CLI interface to OpenOffice.
> > > It works well - I can open a spreadsheet, add data to the cells,
format
> the
> > > cells etc etc.
> > > However, I have failed to add a graphic to a drawpage.
> > > There seems to be no CLI implementation of GraphicObjectShape, so I
> cannot
> > > access the GraphicURL property.
> > > Can anyone help me over this hurdle please?
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > What exactly is GraphicObjectShape? Is it an UNO interface or struct
> > (what is the namespace) and how is this object obtained (for example by
> > using queryInterface or as a return value of some function).
> >
> >
> > --Joachim

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

Reply via email to