Macro: Get Name of current form

Creating and using forms
Post Reply
BirdyB
Posts: 2
Joined: Thu Aug 27, 2015 12:11 pm

Macro: Get Name of current form

Post by BirdyB »

Hello there,

actually i'm creating a database with OO Base. I created a "Startup-Script" which ist run by each form on open. It actually just hides the menubar and some other stuff.
Now i'd like to adjust the window-size depending on the name of the form.
Actually i just don't know, how to get the form name in my macro.

Can anyone help me please?

Thanks a lot!
Openoffice 4.1.1 on MacOS X Yosemite / Windows 7
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: Macro: Get Name of current form

Post by F3K Total »

Hello,
like this?

Code: Select all

Sub get_Form_Name_1
   aArgs = thiscomponent.Args
   for i = 0 to uBound(aArgs)
       if aArgs(i).Name = "DocumentTitle" then 
           sFormName = aArgs(i).Value
           exit for
       end if
   next i
   msgbox (sFormName,64,"Name of the current Form")
end sub
or this

Code: Select all

Sub get_Form_Name_2
   sFormName = Split(thiscomponent.Title," : ")(1)
   msgbox (sFormName,64,"Name of the current Form")
end sub
R
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
Post Reply