Hi Rodrigo,
Wow, you've managed to seriously mangle the macro. :-) Here is what
the original code looks like. Take a look at it and see what you did
wrong. Alternatively, send me the link and the name of the reference
you want to add to the Lookup Tool, and I'll add it for you.
-----------------------------------------------------------------------------
Sub LookupTool()
Dim Library As Object
Dim DialogField As Object
Dim exitOK As String, CurrentItemPos As Integer
"
http://www.askoxford.com/results/?view=searchresults&freesearch=",_
"
http://www.confusingwords.com/index.php?word=",_
"
http://www.britannica.com/bps/search?query=")
ListBoxArray=Array("Wikipedia (En)", "Cambridge Dictionaries Online",_
"Google Define", "WordNet", "Ask Oxford", "BEOLINGUS",_
"Word Source Dictionary", "Word Source Thesaurus", "Confusing Words",
"Encyclopedia Britannica")
ThisDoc=ThisComponent
LookupWord=ThisDoc.getCurrentController().getSelection().getByIndex(0).getString()
If LookupWord="" then MsgBox (MsgWordLookup, 16, MsgAttn) : End
TranslateTextURL=ConvertToURL(LookupWord)
LookupText=Right(TranslateTextURL, Len(TranslateTextURL)-8)
Split1 = Split(LookupText, "&")
LookupText = Join(Split1, "%26")
exitOK=com.sun.star.ui.dialogs.ExecutableDialogResults.OK
OpenDialog("LookupDialog")
Dialog=CreateUnoDialog(TheDialog)
DialogField=Dialog.GetControl("ListBox1")
DialogField.Model.StringItemList() = ListBoxArray()
DialogField.SelectItemPos(0, True)
If Dialog.Execute=exitOK Then
CurrentItemPos=DialogField.SelectedItemPos
BrowseURL(URLArray(CurrentItemPos) & LookupText)
End If
Dialog.Dispose
End Sub
---------------------------------------------------------------------------------