[Solved] Create and run a Window Dialog

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
luigiv
Posts: 2
Joined: Mon Nov 26, 2007 6:02 pm

[Solved] Create and run a Window Dialog

Post by luigiv »

Hello,
The problem is: I want to create a window dialog in OpenOffice.org 2.3 Calc and show it when I press a Button on a Sheet.
I have read a guide: "StarOffice 8 Programming Guide for BASIC" and I have use the following code :
Dim Dlg As Object
DialogLibraries.LoadLibrary("Standard")
Dlg = CreateUnoDialog(DialogLibraries.Standard.DlgDef)
Dlg.Execute()
Dlg.dispose()
but it doesn't work.
My window dialog name is Dialog1
Can you help me?
Thank you.
User avatar
probe1
Volunteer
Posts: 277
Joined: Mon Oct 08, 2007 1:34 am
Location: Chonburi Thailand

Re: Create and run a Window Dialog

Post by probe1 »

luigiv wrote:My window dialog name is Dialog1
so, you have to load that dialog:

Code: Select all

Dlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
Does this work for you?
Cheers
Winfried

DateTime2 extension: insert date, time or timestamp, formatted to your needs
luigiv
Posts: 2
Joined: Mon Nov 26, 2007 6:02 pm

Re: Create and run a Window Dialog

Post by luigiv »

so, you have to load that dialog:

Code: Select all
Dlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1)


Does this work for you?
Yes, it works! :D
Thank you!!!
Post Reply