* Mark Knecht <[EMAIL PROTECTED]> [050207, 18:39]:
> On 2/5/07, Ennio-Sr <[EMAIL PROTECTED]> wrote:
[big cut]
Hi Mark,
in the end it seems that this one should fully meet your goals: it works
for the ws-test-table (with 2 sheets) I created.
Hope it works as well for you.
Good luck!
Ennio
rem --------------------------------------------------------------------
rem Ennio-Sr (alias nasrl.laili) fecit
rem February 7, 2007
rem After selecting a cell in Sheet1, its contents (or that of the cell
rem in another sheet it refers to using an 'absolute address') is
rem copied in Sheet1.$A$1; then the cursor goes back to the starting
rem cell.
rem --------------------------------------------------------------------
sub copyCrtCellToA1andComeBack
rem get the active cell (the one you click at) and its address:
oActiveCell = ThisComponent.getCurrentSelection()
rem *********** Following an example in A.Pitonyak_Macro.sxw ************
'Listing 6.8: Cell address in a readable form using CellAddressConversion.
' oActiveCell = ThisComponent.getCurrentSelection()
oConv =
ThisComponent.createInstance("com.sun.star.table.CellAddressConversion")
oConv.Address = oActiveCell.getCellAddress
ca$= oConv.UserInterfaceRepresentation 'cell address
fca$= oConv.PersistentRepresentation 'full cell address
' Print ca$ ' oConv.UserInterfaceRepresentation
' Print fca$ ' oConv.PersistentRepresentation
rem ***********
oDoc = ThisComponent.CurrentController.Frame
dim dispatcher as object
dim Selection as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$A$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = fca$
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
end sub
--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo. \\?//
Fa' qualche cosa di cui non sei capace!" (diceva Henry Miller) ] (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that. )=(
Do something you aren't good at!" (as Henry Miller used to say) ]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]