Bonjour,
> Voilà toute une matinée que je sèche.
>
> Je voudrais insérer un item de galerie dans un document swriter et je
> ne trouve pas.
J'ai réussi en insérant un objet dessin.
Sub AddItemFromGallery
Dim oGalleryThemes,Magal,MonArc,oShape, oCursor As Object
Dim Size As New com.sun.star.awt.Size
oGalleryThemes = createUnoService("com.sun.star.gallery.GalleryThemeProvider" )
Magal = oGalleryThemes.getByName("toto")
MonArc = Magal.getByIndex(0)
'Taille objet dessin
Size.Width = 1000
Size.Height = 1000
'Création d'un objet dessin
oShape =
thisComponent.createInstance("com.sun.star.drawing.GraphicObjectShape")
oShape.Graphic = MonArc.Graphic
oShape.Size = Size
oShape.Name = "Dessin"
'Curseur de déplacement
oCursor = thisComponent.Text.createTextCursor
'Déplacement à la fin du paragraphe
oCursor.gotoEndOfParagraph(False)
'Insertion de l'objet
thisComponent.Text.insertTextContent(oCursor,oShape,False)
End Sub
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]