Basic form for openoffice base1/11/2024 You can add “RadioGroup” as sTargetType, handled the same as “Button”. These 2 simple subroutines make easy coding to get and place basic data, from there on code for other actions. Rem sTargetType "CheckBox" and "Option" puts the value digit, to put a CheckBox or Option Name use sTargetType "Label" Sub PutToField (sTargetName As String,sTargetContent As String,sTargetType As String) If sTargetType = "CheckBox" Or sTargetType = "Option" Then Rem sTargetType "CheckBox" and "Option" gets the value, to get the CheckBox or Option Name use sTargetType "Label" Here is the final version: Sub GetFromField (sTargetName As String,sTargetType As String) I have figured out myself all the cases most often used. My main advantage is knowing the more obvious places to begin my search which originates from reading a lot of documents. Expended some time in just getting this information together. Here is code to set an item as selected in a list box: Doc = ThisComponentĬlectItemPos(iPointer - 1, True)Īs you may begin to see, there is no universal method to any of this, which again is why you were pointed to the documentation and why your code in the question is not of help.Īnd no, I do not have a some ‘inventory’ but much is done with searching. MsgBox ShowInt,0,"AccountListBox" 'Just for debugging ShowInt = oControl.ValueItemList(oControl.SelectedItems(0)) OControl = oForm.GetByName("lstAccountListBox") Here is code (one of the methods) to get the selected value of a list box: Sub ExecuteAction_AccountListBox Here is a link to adding items to a list box → How to Programmatically add or remove items in ListBox FORM control It checks the state of the buttons in the group and sets other controls visibility. Here is the macro code within that sample: Sub sDispla圜hoice This in itself makes one question what is the sense of providing this information. Also, in the last comment you state the code from of the provided links gives errors (no sample of what you did) andĬould not find any other reference to option or radio-option macro retrieval or settingĮxcept the second link in my comment was just that with an example in it. The code presented has nothing to do with option (radio) buttons and there are numerous ways to do things such as retrieving/setting list box items. You original and edited question (please note edited sections when doing this) are very general in what is asked which is why the documentation was provided. Current versions found here → MRI releases and tutorial here → Introduction into object inspection with MRI and documentation here → MRI documentation Here are some links which will be of vital help:Īlso for a broader view look at Open Office Macros Explained by Andrew Pitonyak. Thank youĮxamining each (you have only a partial list thus far) is covered in documentation already. GetFromField("listbox-Coordinates","ListBox")Īs you can see it’s mostly a question of one line of syntax one needs to know.Ĭan I get some help please in getting the lines that need to be added to the subroutines in order to handle the other types of fields mentioned. If sTargetType = "Label" Or sTargetType = "Button" Then Sub GetFromField (sTargetName As String, sTargetType As String) If sTargetType = "Text" Or sTargetType = "Label" Then Sub PutToField (sTargetName As String, sTargetContent As String, sTargetType As String) However in spite of many alternative tests I haven’t figured out yet how to get content from option and radio-option fields. In the GetFromField subroutine, the code below works for fieldtype listbox, text, label, button-name and checkbox. However in spite of many alternative tests I haven’t figured out yet how to get content to a listbox, option or radio-option field. In the PutToField subroutine, the code below works for fieldtypes text, label, button-name and checkbox, I can even put Now() in the place of “mynewtext” and put a date. The coding to put or get a field’s value depends on the file type such as -text, label, listbox, checkbox, radio-option, image, button-name. I wish to make a sub-routine for getting a value from a field, and one for putting a value to a field. I use lots of macros in my forms to handle conditional situations, resulting in intervention in database tables via sql, or changing form field content or presentation (enable/visible or not). My environment: Windows 10, LibreOffice Version: 6.4.0.3 (圆4) HSQLDB Split Database
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |