5 messages in org.openoffice.fr.progRe: [prog] Test embeddedObjects.getBy...
FromSent OnAttachments
Bernard Siaud alias TroumadJan 4, 2009 2:49 am 
Laurent GodardJan 4, 2009 5:12 am 
Bernard Siaud alias TroumadJan 4, 2009 9:33 am 
Agnès SimonetJan 4, 2009 1:43 pm 
Bernard Siaud alias TroumadJan 4, 2009 9:48 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] Test embeddedObjects.getByName(elementNames(i)).Model emptyActions...
From:Bernard Siaud alias Troumad (lis@siaud.org)
Date:Jan 4, 2009 9:33:33 am
List:org.openoffice.fr.prog

Laurent Godard a écrit :

Bonjour bernard

Je dois vérifier si embeddedObjects.getByName(elementNames(i)).Model vaut <empty> d'après xray

reponse = isEmpty(embeddedObjects.getByName(elementNames(i)).Model) c'est un booleen

Voici le code complet. Cette fois il marche. Sauf qu'après modification, je ne peux pas sauver le fichier ! Le test sur un fichier avec seulement une équation est bon ! J'ai remarqué que tu utilisais une autre méthode de parcours dans ta fonction qui mettait toutes les polices à la même taille.

Sub Main ChangeFormatFormule End Sub

Sub ChangeFormatFormule thiscomponent.lockcontrollers embeddedObjects = ThisComponent.getEmbeddedObjects() elementNames = embeddedObjects.getElementNames() for i=0 to UBOUND(elementNames) element = embeddedObjects.getByName(elementNames(i)).Model

if (not isEmpty(element)) then if (element.supportsService("com.sun.star.formula.FormulaProperties")) then element.BaseFontHeight = 12 ' element.FontNameVariables= "Arial" ' element.FontNameFunctions = "Arial" ' element.FontNameNumbers= "Arial" ' element.FontNameText= "Arial" element.setmodified(true) endif endif next i ThisComponent.reformat() thiscomponent.unlockcontrollers

End Sub

Bon courage Merci ! Laurent

Il va falloir que je regarde aussi vos astuces pour ouvrir les formules afin d'avoir une taille 12 aussi à l'affichage !