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

(ubuntu) Startup macro

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


Joined: 29 Mar 2004
Posts: 308

PostPosted: Sat Mar 06, 2010 3:01 pm    Post subject: (ubuntu) Startup macro Reply with quote

I am trying to make a macro that runs on startup. Its purpose is to paste the clipboard into a blank text document. What do I need to change?

This is as far as I have got:

I run this from the command line:

oowriter "macro:///Standard.Module1.Paste_on_start"


I get the Basic runtime error. Property or method not found.

This is the line that causes the error message to pop up:
document = ThisComponent.CurrentController.Frame


Quote:
REM ***** BASIC *****

Sub Main

End Sub


sub Paste_on_start
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelpe r")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())


end sub
_________________
Robin

When you love a delicate rose remember she has thorns and a root. In time the petals will fall away.
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