Hello all,

I'm trying to insert my generated XSpreadsheet into an swriter component:

--------------
Reference<XComponent> oowriter       =
this->createComponent( "private:factory/swriter" );

Reference<XMultiServiceFactory> fac(oowriter,UNO_QUERY);

Reference<XTextEmbeddedObject> 
object(fac->createInstance("com.sun.star.text.TextEmbeddedObject"), 
UNO_QUERY);

When I checked the reference with "is()" I got NULL;()

Any hints or a complete code snippet?

I found a basic code-snippet, which I want to translate to C++:

---------------------
sub Main
    oDoc = ThisComponent
    txt=oDoc.getText
    Set TextCursor = txt.createTextCursor
    Set TextEmbeddedObject = 
oDoc.createInstance("com.sun.star.text.TextEmbeddedObject")
    Dim asize As New com.sun.star.awt.Size
    asize.Height =10000
    asize.Width = 10000
    TextEmbeddedObject.CLSID = "47BBB4CB-CE4C-4E80-a591-42d9ae74950f"
    txt.insertTextContent TextCursor, TextEmbeddedObject, False
    TextEmbeddedObject.setSize asize
    Set SpreadSheetDoc = TextEmbeddedObject.getEmbeddedObject
    oSheets=SpreadSheetDoc.getSheets
    oSheet = oSheets.getByIndex(0)
    oCell = oSheet.getCellByPosition(0, 0)
    oCell.setString "ABCD"
    end sub 
---------------------

Best regards

Andre

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

Reply via email to