I cant figure out a formula to do it. So I tried to make a macro function to facilitate my aims but I cant make my code work.
Im not familiar with oOcalc DOM's to manipulate the item.
Hope someone can help me out. Thanks.
Code: Select all
Function noteparse( ocol As Variant )
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oSelectedCells = ThisComponent.CurrentSelection
oActiveCell = oSelectedCells.CellAddress
dispatcher.executeDispatch(document, ".uno:DrawEditNote", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:InsertAnnotation", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:SelectAll", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:DrawEditNote", "", 0, Array())
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "ToPoint"
args6(0).Value = ocol
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args6())
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "ToPoint"
args7(0).Value = oActiveCells
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args7())
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
End Function