Hi,
the following basic script will insert a form control into a spreadsheet.
but it is not possible to print the form control (have a look at the print
preview)
printing of the form control will only work after a save & relaod ...
any hints whats wrong ?
no problems so far with oo 2.0 ...
i should have a bugfix for this ...
regards
Oliver
--
Option Explicit
Sub CreateControl()
Dim oDocument as Object
Dim oView as Object
Dim oDrawPage as Object
Dim oControlModel as Object
Dim oControlShape as Object
Dim oSize as New com.sun.star.awt.Size
Dim oPosition as New com.sun.star.awt.Point
oDocument = StarDesktop.getCurrentComponent
oView = oDocument.CurrentController
oDrawPage = oView.getActiveSheet.DrawPage
oControlShape =
oDocument.createInstance("com.sun.star.drawing.ControlShape")
oSize.Height = 1000
oSize.Width = 3000
oPosition.X = 2000
oPosition.Y = 3000
oControlShape.setSize(oSize)
oControlShape.SizeProtect = True
oControlShape.setPosition(oPosition)
oControlShape.MoveProtect = True
oControlModel =
createUNOService("com.sun.star.form.component.CommandButton")
oControlModel.Name = "My Control"
oControlModel.Label = "Test"
oControlModel.Printable = True
oControlModel.Enabled = True
oControlShape.setControl(oControlModel)
oDrawPage.add(oControlShape)
End Sub
--
Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,
DSL-Flatrate für nur 4,99 Euro/Monat* http://www.gmx.net/de/go/dsl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]