a ver si alguien me puede echar un cable. Tengo unos hyper enlances que añado desde una macro en un informe de base. Funciona bien, pero el problema es que no soy capaz de encontrar una forma de añadir un texto tooltip a esos hyper enlaces.
REM ***** BASIC *****
sub Main
Dim x As Integer
Dim n As Integer
x = 2
n = 6
Cell = ThisComponent.getSheets.getByIndex(0)
Cell = Table.getCellByPosition(x, n)
Content = Cell.Text
Curs = Content.createTextCursor()
Curs.gotoStart(False)
Curs.gotoEnd(True)
'Curs.HyperLinkURL = "vnd.sun.star.script:standard.module1.HyperlinkFF?language=Basic&location=document"
AgregarComentarioCelda(x, n, "Esto es un Comentario")
' BorrarComentario(x, n)
end sub
sub AgregarComentarioCelda(x As Integer, n As Integer, Comentario As String)
Dim oComentarios As Object
oHoja = ThisComponent.getSheets.getByIndex(0)
'La activamos
ThisComponent.getCurrentController.setActiveSheet(oHoja)
' creo el comentario
oComentarios = oHoja.getAnnotations
oCelda = oHoja.GetCellByPosition( x, n)
oComentarios.insertNew( oCelda.CellAddress, Comentario )
oCelda.Annotation.isVisible = False
' Tipo de letra - tamaño - color
With oCelda.Annotation.getAnnotationShape()
.charFontName = "Arial"
.charHeight = 12
.CharColor = RGB(0,0,0)
' también con .setPropertyValue( "CharHeight" , nPuntos ), etc
End With
' Tamaño del comentario
Dim sFrameRectNew As New com.sun.star.awt.Rectangle
sFrameRectNew.X = 10
sFrameRectNew.Y = 10
sFrameRectNew.width = 21000
sFrameRectNew.height = 2000
oCelda.Annotation.getAnnotationShape().FrameRect = sFrameRectNew
' Fin del comentario
end sub
Sub BorrarComentario(x As Integer, n As Integer)
'Referencia a la nueva hoja o a la existente
oHoja = ThisComponent.getSheets.getByIndex(0)
'La activamos
ThisComponent.getCurrentController.setActiveSheet(oHoja)
Dim oComentaros As Object
'Borramos solo los Comentarios
oComentarios = oHoja.getAnnotations
oCelda = oHoja.GetCellByPosition( x, n)
oCelda.clearContents( 8 )
end sub
______________________________________________
"Todo cuanto no podemos dar nos posee". - André Gide
LibreOffice 6.2 | ArchLinux | Gnome3 No respondo preguntas privadas, por favor, usa el foro
por que raro?, LibreOffice no es una aplicación web...
______________________________________________
"Todo cuanto no podemos dar nos posee". - André Gide
LibreOffice 6.2 | ArchLinux | Gnome3 No respondo preguntas privadas, por favor, usa el foro
es raro porque en una definición de hyperlink normal, sí que podemos poner un tooltip... por eso me parece raro que la api de AOO no tenga algo para ponerlo de esta manera..
OpenOffice última versión | Windows XP X64 | Windows 8.1 X64 | Mageia Linux x64 | Java 1.8.0_231
si lo que quieres es definir un tooltip, ya te di la respuesta, no es posible.
______________________________________________
"Todo cuanto no podemos dar nos posee". - André Gide
LibreOffice 6.2 | ArchLinux | Gnome3 No respondo preguntas privadas, por favor, usa el foro