I’m attempting to assign the text from a Base form ListBox single selection to a string variable. Using the following code gives me a ‘Property or Method not found’ error.
Sub GetLBtext
Dim oForm As Object
Dim oField As Object
Dim var As String
oForm= ThisComponent.Drawpage.Forms.getByName("Form Name With ListBox_1")
oField = oForm.getByName("ListBox_1").getSelectedItem()
var = oField
End Sub
Upon some research, I came accross this discussion [Solved] Pass ListBox selected item to Textfield (View topic) • Apache OpenOffice Community Forum at the Open Office Forum that I’m pretty sure contains the answer I’m looking for, but its content is way over my head. Any chance I could get someone out there to explain to me how to properly go about this? As you may have guessed I’m a total LO Basic noob, so please be gentle