Hi all,
I’m not a programmer, I’m a pro A/V tech who works primarily on Broadway style musicals. I’m trying to write a macro that will find my current cursor position and attach a small blue circle, labelled with a number that relates to a fader on my sound console. I’m having trouble getting the document to find the current drawpage, but only not in text documents. I need this to work in Impress, as scripts generally come to me in PDF form. It’s currently set for a hard position (aposition), once I can get the current page figured out, I’ll take a crack at relating it to cursor position. Thanks in advance!
`Sub InsertProcessShape
Dim oDoc As Object
Dim oDrawPage As Object
Dim oShape As Object
Dim shapeGeometry(0) as new com.sun.star.beans.PropertyValue
Dim oSize As new com.sun.star.awt.Size
oSize.width = 1200
oSize.height = 1200
oDoc = Stardesktop.getCurrentComponent()
MsgBox oDoc.getImplementationName()
oDrawPage = oDoc.getDrawPage()
oShape = oDoc.createInstance("com.sun.star.drawing.EllipseShape")
shapeGeometry(0).Name = "Type"
shapeGeometry(0).Value = "Circle"
oDrawPage.add(oShape)
oShape.Size = oSize
oShape.FillStyle = com.sun.star.drawing.FillStyle.NONE
oShape.LineWidth = 170
oShape.LineColor = 220
Dim aPosition As New com.sun.star.awt.Point
aPosition.X = 8000
aPosition.Y = 8000
oShape.setposition(aPosition)
oShape.Text.String = "1"
oShape.Text.CharHeight = 20
oShape.Text.CharFontName = "Alef"
End Sub`