Note's dimension

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
briglia23
Posts: 155
Joined: Tue Jun 24, 2008 10:09 am

Note's dimension

Post by briglia23 »

Is possible set note's dimension by macro?

Thank you
OOo 2.3.X on openSuse 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Note's dimension

Post by Villeroy »

You have The Xray Tool and my Function getActiveCell installed? Let's roll:

Code: Select all

Sub Main
oDoc = thisComponent
oView = oDoc.getCurrentController()
oSheet = oDoc.Sheets.getByIndex(0)
'GlobalScope.BasicLibraries.loadLibrary("CalcTools") 'library of getActiveCell()
oCell = getActiveCell(oView)
GlobalScope.BasicLibraries.loadLibrary("XrayTool")
' xray oCell
oNote = oCell.getAnnotation() 'or pseudo-property .Annotation
' xray oNote
oShape = oNote.getAnnotationShape() 'or pseudo-property .AnnotationShape
xray oShape
oSize = oShape.getSize() ' or pseudo-property .Size
print oSize.Width, oSize.Height
oPosition = oShape.getPosition() ' or pseudo-property .Position
print oPosition.X, oPosition.Y
End Sub
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply