[Solved] How to add a gallery image into a Writer table Cell
Posted: Fri Dec 16, 2011 5:32 pm
I have the following code snippet :
Having the reference to the TableCellCursor of a Writer document , how can I add the gallery image to that position ? Is there any method that helps me to get a gallery item by name ?
Code: Select all
Sub Main
Dim momDocument, maTable As Object
Dim cursCell as Object
monDocument = ThisComponent
maTable = monDocument.TextTables.getByName( "Tableau1" )
cursCell = maTable.createCursorByCellName( "A1" )
oGTP = CreateUnoService("com.sun.star.gallery.GalleryThemeProvider")
sName = "ACVF-A..D"
If oGTP.hasByName(sName) Then
oTheme = oGTP.getByName(sName)
nCount = oTheme.getCount()
oItem = oTheme.getByIndex(nCount -1)
// how to add the gallery image to the cell pointed by cursCell ?
End If
End Sub
Code: Select all
cursCell
Code: Select all
oItem