das funktioniert so:
Code: Alles auswählen
sub New_Veusz_Diagram
Dim Point As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
odoc = ThisComponent
osheet = odoc.sheets.getbyname("Tabelle1")
opage = osheet.drawpage
oshape= odoc.createInstance("com.sun.star.drawing.GraphicObjectShape")
with oshape
.name ="VeuszTextBox"
end with
opage.add(oshape)
with oshape
.String = "Text Content"
'.GraphicURL= converttourl("D:\MyBlueTemplate.bmp")
.Description = "Image Description"
Size.Width = 10000
Size.Height = 10000
.Size = Size
Point.x = 600
Point.y = 600
.Position = Point
end with
Dim aEventArgs(1) as new com.sun.star.beans.PropertyValue
aEventArgs(0).Name = "EventType"
aEventArgs(0).Value = "Script"
aEventArgs(1).Name = "Script"
aEventArgs(1).Value = "vnd.sun.star.script:Standard.Module1.Test_Event?language=Basic&location=document"'Hier Library.Modul.Makro einfügen, es gibt auch location=application
oshape.Events.replaceByName("OnClick",aEventArgs)
end sub
Sub Test_Event
Msgbox "Das war ein sauberer Klick"
end sub