Merci ça marche !
Une question : pour la taille de 20 au tableau elements ?
Voici mon code et est-ce que je peux le donner ici :
https://forum.openoffice.org/fr/forum/viewtopic.php?p=360542#p360542
Sub choix
dim i,j,taille,drap as integer
dim mode as Variant
dim PysField as object
dim nomType as string
dim newType as string
dim elements(20)
dim document as object
dim dispatcher as object
rem mettre la liste des types souhaités
mode = Array("impression", "complet")
drap=0
taille=Ubound(mode)
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
elements = ThisComponent.TextFieldMasters.getElementNames()
rem Chercher la variable "affichage"
for i=0 to ubound(elements)
if (instr(elements(i),"affichage")>0) then
valeur=
ThisComponent.TextFieldMasters.getByName(elements(i)).DependentTextFields(0).content
for j= 0 to taille
if mode(j) = valeur then
if j<taille then
drap=1
ThisComponent.TextFieldMasters.getByName(elements(i)).DependentTextFields(0).content
= mode (j+1)
endif
endif
next j
if drap=0 then rem prendre en compte le plus grand et
les cas non prévus
ThisComponent.TextFieldMasters.getByName(elements(i)).DependentTextFields(0).content
= mode (0)
endif
dispatcher.executeDispatch(document,
".uno:UpdateFields", "", 0, Array()) REM mettre à jour l'affichage
i=ubound(elements)
endif
next i
End Sub
--
Amicalement vOOotre Troumad Alias Bernard SIAUD
mon site : http://troumad.org : AD&D maths WEB...
Pour la liberté http://www.developpez.net/forums/f17/systemes/linux/
N'envoyez que des documents avec des formats ouverts, comme
http://fr.libreoffice.org
--
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour vous désinscrire
Les archives de la liste sont disponibles à https://listarchives.libreoffice.org/fr/users/
Privacy Policy: https://www.documentfoundation.org/privacy
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.