OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

uno dispatch calls

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
thuber
Newbie
Newbie


Joined: 03 Feb 2009
Posts: 2

PostPosted: Tue Feb 03, 2009 10:16 am    Post subject: uno dispatch calls Reply with quote

Two questions for a calc macro:

1) This copies to the clipboard the currently selected cell:

Code:
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())

Can I modify this so it copies a hard coded location(for example $B$1)

2) How can I modify the below snippet to save the currently selected cell, then later issue the dispatch to go to that cell.

Code:
args1(0).Name = "ToPoint"
args1(0).Value = "$B$1"
rem dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

Thanks!
Back to top
View user's profile Send private message
thuber
Newbie
Newbie


Joined: 03 Feb 2009
Posts: 2

PostPosted: Wed Feb 04, 2009 2:34 pm    Post subject: Saving currently selected cell Reply with quote

I solved problem #2 by adding two subroutines::

Code:
Global oSheet, oSel
Sub GetPos
oSel = ThisComponent.CurrentController.Selection
oSheet = ThisComponent.CurrentController.ActiveSheet
End Sub

Sub PutPos
ThisComponent.CurrentController.ActiveSheet = oSheet
ThisComponent.CurrentController.Select(oSheet.getCellByPosition( _
         oSel.RangeAddress.EndColumn, oSel.RangeAddress.EndRow))
End Sub


My question #1 I still don't have a solution, any help appreciated.

Thanks! -Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group