Property or method not found: getEmbeddedObjects.

asked 2019-08-17 23:25:04 +0200

updated 2019-08-17 23:39:41 +0200

Ratslinger gravatar image

I am trying to run the code below on a presentation containing equations, but I get the following error:

BASIC runtime error. Property or method not found: getEmbeddedObjects.

I don't know why it is not being found - any ideas? Thanks.

REM  *****  BASIC  *****
Sub ReformatFormulas
    embeddedObjects = ThisComponent.getEmbeddedObjects()
    elementNames = embeddedObjects.getElementNames()
    for i=0 to UBOUND(elementNames)
        element = embeddedObjects.getByName(elementNames(i)).Model
        oXEO = embeddedObjects.getByName(elementNames(i)).ExtendedControlOverEmbeddedObject
        iCurrentState = oXEO.currentState
        oXEO.changeState(com.sun.star.embed.EmbedStates.UI_ACTIVE)
        if (not isNull(element)) then
            if (element.supportsService("com.sun.star.formula.FormulaProperties")) then
                element.BaseFontHeight = 10
                element.FontNameVariables= "Times New Roman"
                element.FontVariablesIsItalic=1
                element.FontNameFunctions = "Times New Roman"     
                element.FontNameNumbers= "Times New Roman"        
                element.FontNameText= "Times New Roman"       
            endif
        endif
    next i
End Sub
edit retag flag offensive close merge delete

Comments

Edited for clarity. Please use preformatted text icon on toolbar for this.

Ratslinger gravatar imageRatslinger ( 2019-08-17 23:40:59 +0200 )edit