I am trying to get the selectedText from a ComboBox. This is the code I am trying:
Function GetSelectedText(oDialog As Object, comboBoxName As String) As String
Dim oComboBox As Object
Dim selectedText As String
' Get the ComboBox control by name from the dialog
oComboBox = oDialog.getControl(comboBoxName)
' Check if the ComboBox control exists
If Not IsEmpty(oComboBox) Then
' Retrieve the text of the selected item
selectedText = oComboBox.Text
MsgBox "selectedText = """ & selectedText &""""
Else
MsgBox "ComboBox control '" & comboBoxName & "' not found on the dialog."
End If
' Return the selected text
GetSelectedText = selectedText
End Function
I always get: "selectedText = " even though the oComboBox has selected text.
The documentation I have seen hasn’t been helpful.
Help would be appreciated.