Bonjour,
Donc, en fait dans le listing de Pierre, il fallait remplacer
MonDocument.CreateInstance par uneFamille.CreateInstance
C'est différent des styles dans Writer...
Bonne fin de dimanche...
JM
Le 07/06/2020 à 14:59, pierre-yves samyn a écrit :
Suite...
J'ai oublié d'utiliser la constante dans l'instruction de création.
Il faut donc remplacer par :
Sub PysCreateGraphicStyle
const STYLE_NAME = "pys"
Dim oDoc As Object
Dim oGraphics As Object
Dim oStyle As Object
oDoc = ThisComponent
oGraphics =oDoc. StyleFamilies.getByName("graphics")
if oGraphics.hasByName(STYLE_NAME) then
msgbox "Le style " & STYLE_NAME & " est déjà créé", MB_ICONINFORMATION,
"Création de style"
else
oStyle = oGraphics.createInstance("com.sun.star.style.Style")
oStyle.parentStyle = "objectwithoutfill"
oGraphics.insertByName( STYLE_NAME, oStyle)
end if
End Sub
Cordialement
--
Sent from: http://document-foundation-mail-archive.969070.n3.nabble.com/Users-f1744091.html
--
Jean-Michel COSTE
--
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.