problems with Writer's tools

14 views
Skip to first unread message

wilbersa

unread,
Feb 17, 2009, 8:44:17 AM2/17/09
to WriterTools
Hi all,
I just downloaded the extension and installed it into my version of
open office 3.0. The platform my computer uses is Windows xp home. I
also downloaded the Writer's tools manual (payed around 8 or 9 €).
Then when I started to get through this extension, a consistent error
showed up every time I was trying to use the different applications of
this extension.

First the open office basic opens with a small error window saying:

Basic syntax error
expected: Sub

then a small arrow shows at the lookup tool section of this script:
a script I wrote following the writer's tools indications:

URLArray=Array("http://en.wikipedia.org/wiki/",_
"http://dictionary.cambridge.org/results.asp?searchword=",_
"http://www.google.com/search?q=define%3A",_
"http://wordnet.princeton.edu/perl/webwn?s=",_
"http://www.askoxford.com/results/?vew=searchresults&freesearch=",_
"http://dict.tu-chemnitz.de/dings.cgi?lang=en&query=",_
"http://word.sc/",_
"http://word.sc/thes/",_
"http://dictionary.reference.com/browse/")
ListBoxArray=Array("Wikipedia (En)", "Cambridge Dictionaries Online",_
"Google Define", "WordNet", "Ask Oxford", BEOLINGUS",_
"Word Source Dictionary", "Word Source Thesaurus", Dictionary.com")

Could anyone tell me what I'm doing wrong?.
Cheers,

Rodrigo


Dmitri Popov

unread,
Feb 17, 2009, 9:50:26 AM2/17/09
to write...@googlegroups.com
Hello,

It looks like you deleted the very last line of the Lookup Tool macro.
Make sure that the LOOKUP TOOL macro ends with "End Sub", so that the
last four lines of the macro are as follows:

BrowseURL(URLArray(CurrentItemPos) & LookupText)

End If

Dialog.Dispose

End Sub

If it doesn't work, try to remove and install the Writer's Tools
extension again.

Kind regards,
Dmitri
---
Productivity Sauce: www.linuxpromagazine.com/productivitysauce
Writer's Tools: writertools.googlecode.com

wilbersa

unread,
Feb 17, 2009, 7:46:36 PM2/17/09
to WriterTools
Hi Dimitri,
Thanks for your fast answer, I followed your advise, and yet, I still
getting a error message but this time the arrow is placed in one of
the lines you gave mi to complete the script. the error message
indicates the line

End If,
bellow I pasted the whole script:

Sub LookupTool()
URLArray=Array("http://en.wikipedia.org/wiki/",_
"http://dictionary.cambridge.org/results.asp?searchword=",_
"http://www.google.com/search?q=define%3A",_
"http://wordnet.princeton.edu/perl/webwn?s=",_
"http://www.askoxford.com/results/?vew=searchresults&freesearch=",_
"http://dict.tu-chemnitz.de/dings.cgi?lang=en&query=",_
"http://word.sc/",_
"http://word.sc/thes/",_
"http://dictionary.reference.com/browse/")
ListBoxArray=Array("Wikipedia (En)", "Cambridge Dictionaries Online",_
"Google Define", "WordNet", "Ask Oxford", "BEOLINGUS",_
"Word Source Dictionary", "Word Source Thesaurus", "Dictionary.com")
BrowseURL(URLArray(CurrentItemPos) & LookupText)
End If (here goes the arrow indicating the error in the script)
Dialog.Dispose
End Sub

Greetings

Rodrigo


On Feb 17, 3:50 pm, Dmitri Popov <lazyl...@gmail.com> wrote:
> Hello,
>
> It looks like you deleted the very last line of the Lookup Tool macro.
> Make sure that the LOOKUP TOOL macro ends with "End Sub", so that the
> last four lines of the macro are as follows:
>
> BrowseURL(URLArray(CurrentItemPos) & LookupText)
>
> End If
>
> Dialog.Dispose
>
> End Sub
>


> If it doesn't work, try to remove and install the Writer's Tools
> extension again.
>
> Kind regards,
> Dmitri
> ---
> Productivity Sauce:www.linuxpromagazine.com/productivitysauce
> Writer's Tools: writertools.googlecode.com
>

Dmitri Popov

unread,
Feb 18, 2009, 4:29:58 AM2/18/09
to write...@googlegroups.com
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

---------------------------------------------------------------------------------

Kind regards,
Dmitri
---
Productivity Sauce: www.linuxpromagazine.com/productivitysauce
Writer's Tools: writertools.googlecode.com



Reply all
Reply to author
Forward
0 new messages