Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


Hi,

Alain ANTOCI schrieb:
Hi,


I use Delphi to develop an application which needs to work with MS
office and LibreOffice. I've a question about Chart in Libreoffice, I
need to access a chart in a libreoffice document to change values. I try
to use GetCharts then getbyname or getbyindex like in calc but it
doesn't seem to work is there anything to do, i've seen some posts
talking about writer and ole object it doesn't seem to be support yet.


Can you confirm to me if it is possible or not, or is it schedule in a
future version please ?

Charts are OLE objects. Use the Basic macro below (you might need to fix unwanted line breaks) and the Basic IDE to examine the Chart-object. In the column Type in the watch-window and in the variable "SupportedServiceNames" you will find the hints, which part of the API is relevant. The variable "Types" contains information about the supported methods. Or use Xray (in Basic) to examine the objects to learn the supported methods.

You can start examine the objects, if you set a break point at the line "msgbox" inside the for-loop and add the objects to the Watch-window.

Kind regards
Regina

sub ExamineEmbeddedObjects
dim oCurrentController as variant: oCurrentController = ThisComponent.getCurrentController()
dim oDoc as variant: oDoc=ThisComponent
if not(oCurrentController.supportsService("com.sun.star.text.TextDocumentView")) then
        msgbox("Macro works only in text documents.")
        exit sub
end if
dim oModelTextDocument as variant: oModelTextDocument = oCurrentController.Model dim oEmbeddedObjects as variant: oEmbeddedObjects = oModelTextDocument.EmbeddedObjects
dim nIndex as long
dim nEndIndex as long: nEndIndex = oEmbeddedObjects.Count-1
dim oEmbeddedObject as variant: rem like green handle status
dim oModel as variant: rem like edit status
dim oXCOEO as variant: rem oExtendedControlOverEmbeddedObject
for nIndex=0 to nEndIndex
        oEmbeddedObject = oEmbeddedObjects.getByIndex(nIndex)
        oModel = oEmbeddedObject.Model: rem I'm not sure, whether it might be empty
        if Not(isEmpty(oModel)) then
        Rem Do something with the object
    Rem Use xray or Basic IDE to examine the object
        msgbox("I am: " & oEmbeddedObject.StreamName)
                oXCOEO = oEmbeddedObject.ExtendedControlOverEmbeddedObject
                oXCOEO.update()                 
        end if
next nIndex
end sub


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.