I use English USA locale. Consider the following Calc macro that sets line starts and line ends based on the name (which I assume is the correct way to do this). Will this work in other languages such as German, French, Russian, Polish, Chinese?

Sub InsertLineInCalcDocument
  Dim oLine
  Dim oCell1
  Dim oCell2
  Dim oSheet

  Dim oPos as new com.sun.star.awt.Point
  Dim oSize as new com.sun.star.awt.Size
  Dim oPage

  oSheet = ThisComponent.Sheets(0)
  oCell1 = oSheet.getCellByPosition(1, 1)
  oCell2 = oSheet.getCellByPosition(3, 3)

  oLine = ThisComponent.createInstance("com.sun.star.drawing.LineShape")

  oPos.x = oCell1.Position.X
  oPos.y = oCell1.Position.Y
  oLine.Position = oPos

  oSize.Width = oCell2.Position.X - oCell1.Position.X
  oSize.Height = oCell2.Position.Y - oCell1.Position.Y
  oLine.Size = oSize

  oLine.LineWidth = 4
  oLine.LineColor = RGB(128, 0, 0)
  oPage = oSheet.getDrawPage()


  REM You must do this AFTER inserting the line into the page.
  oLine.LineEndName = "Arrow"
  oLine.LineStartName = "Double Arrow"
End Sub

Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php

To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help

Reply via email to