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

Problem with dialog in API

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





PostPosted: Fri Jun 27, 2003 3:45 am    Post subject: Problem with dialog in API Reply with quote

Question Exclamation Question
Hello, I beginning user OpenOffice, but well know VBA.
I have problems with creation of dialogue (form).
I have created the form (MYdialog), but I do not know, how it to start from the module.
I looked the Help in ОО and other documentation. But not so well it has understood.
If it is possible, write to me the text of the program starting the form with a button. By pressing this button there should be any message.
Or send on Bsvsvb@rambler.ru
Thank you.
Back to top
Guest






PostPosted: Sat Jun 28, 2003 9:53 am    Post subject: Reply with quote

If your form is on a writerdocument do it like this:

Code:

Sub openFormOnAWriterDocument
   
   Dim sUrl as String
   Dim oDesktop as Object
   
   oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
   sUrl = "file:///home/user/path/to/your/form.stw"

   oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
   oDesktop.loadComponentFromUrl( sUrl , "_blank", 0, mNoArgs() )

End Sub


If your using a dialog:

Code:


Dim oMyDialog as Object

Sub openDialog
   DialogLibraries.LoadLibrary( "Standard" )
   oMyDialog = CreateUnoDialog( DialogLibraries.Standard.MyDialog )
   oMyDialog.Execute()
End Sub

Sub closeDialog
   oMyDialog.EndExecute()
End Sub




Of course you must adjust the path to your document or to the dialog in one of your libraries.
Back to top
uros
Super User
Super User


Joined: 22 May 2003
Posts: 601
Location: Slovenia

PostPosted: Mon Jun 30, 2003 2:56 am    Post subject: Reply with quote

Try with OpenOffice.org 1.0.2 SDK - DevelopersGuide, chapter 11 - Basic And Dialogs
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