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

Macros for opening the existing document

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


Joined: 14 Aug 2009
Posts: 52

PostPosted: Wed Dec 23, 2009 11:37 pm    Post subject: Macros for opening the existing document Reply with quote

I have recorded macro for opening the exisitng file. I tried opening my file at path c:/Untitled 1.ots .

The code generated is
sub openexist
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.DispatchHelper")

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


end sub

----------------------------
But when i am running the macro, it doesnt open that file. and shows error.

Are there tutorials available for macros learning. what are the pre condition for recording the macros. how to run those macros. What are modification needs to be done once the macro is recorded.
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Wed Dec 23, 2009 11:58 pm    Post subject: Reply with quote

Take a look at the StarOffice 8 Programming Guide for BASIC (http://docs.sun.com/app/docs/doc/819-0439/faanp?l=en&q=staroffice+basic&a=browse). Opening an existing file is there covered in the chapter 5. Working with StarOffice Documents (http://docs.sun.com/app/docs/doc/819-0439/6n2s7ri04?l=en&a=view#indexterm-180): loadComponentFromURL().
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