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

Dear all,

I have a problem with Libreoffice Impressfor which I didn't find any
solution in internet.

My problem:
I have a presentation with lots of equations and I want to change the
fonts in this presentation. For normal text this is easily done changing
the corresponding styles. However, so far I didn't find a way to change
the fonts of all equations (in an efficient way, without modifying each
equation manually).

I understand that I need a macro for doing this. In the Math
documentation on
page 46 I found a macro which works nicely in Libreoffice Writer, but
not in Impress.
On page 47 it is said that in Impress some modifications are necessary.
I made these modifications (hopefully correctly, I am not sure), but the
macro does not work, giving me the error message

BASIC runtime error.
Property or method not found: EmbeddedObjects

My macro is this (essentially the one from the documentation):

Sub ChangeFormatFormuleImpress
oCurrentController = ThisComponent.getCurrentController()
oTextDocument = oCurrentController.Model
oEmbeddedObjects = oTextDocument.EmbeddedObjects
nEndIndex = oEmbeddedObjects.Count-1
for nIndex=0 to nEndIndex
oMathObject = oEmbeddedObjects.getByIndex(nIndex)
oModel = oMathObject.Model
if (not isNull(oModel)) then
if(not isEmpty(oModel)) then
if oShape.supportsService("") then
if oShape.CLSID = "078B7ABA-54FC-457F-8551-6147e776a997" then
oModelFormula = oShape.Model
oModelFormula.BaseFontHeight = 12
oModel.BaseFontHeight = 12
policeCommune= "Arial"
' Variables
oModel.FontNameVariables= policeCommune
' Functions
oModel.FontNameFunctions = policeCommune
' Numbers
oModel.FontNameNumbers= policeCommune
' Text
oModel.FontNameText= policeCommune
' Update
oXCOEO = oMathObject.ExtendedControlOverEmbeddedObject
endif ' if formula
endif ' if not empty
endif ' if not null
next nIndex
ThisComponent.reformat() ' Met à jour tous les éléments du document
End Sub

Because I have never written a Libreoffice macro before, I am lost here
and any help would be appreciated.

My system: Libreoffice 4.1.1, Linux, 64 bit


To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


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.