Home

Macros and Programming

 

CardboxForumsMacros and Programming > "Search Macro with spelling dictionary"

Search Macro with spelling dictionary

Is it poosibel to have a search with drop down box of common spelled words?

Current user: [none]
Register / Log In · Help

Posted By Post

Woody123

17-Feb-2012 09:54

Okay so I have the following code below that I got from the forums.

Dim Qsearch,Word,NewSearch
On Error Resume Next

SelectionLevel=0

Qsearch = InputBox ("Enter Your Search","Quick search")

If Qsearch = "" Then Halt

Word = Split (Qsearch)

ActiveWindow.Select "",(Word(0)) & "*"
Sleep 10
ActiveWindow.Select "",(Word(1)) & "*"
Sleep 10
ActiveWindow.Select "",(Word(2)) & "*"
Sleep 10
ActiveWindow.Select "",(Word(3)) & "*"

If RecordCount = 0 and SelectionLevel = 4 Then
MsgBox "No Matching Records Found!",64,"Quick Search for...'" & (Word(3)) & "'"
UndoOneSelectionLevel
End If

If RecordCount = 0 and SelectionLevel = 3 Then
MsgBox "No Matching Records Found!",64,"Quick Search for...'" & (Word(2)) & "'"
UndoOneSelectionLevel
End If

If RecordCount = 0 and SelectionLevel = 2 Then
MsgBox "No Matching Records Found!",64,"Quick Search for...'" & (Word(1)) & "'"
UndoOneSelectionLevel
End If

If RecordCount = 0 and SelectionLevel = 1 Then
MsgBox "No Matching Records Found!",64,"Quick Search for...'" & (Word(0)) & "'"
UndoOneSelectionLevel
End If

Its really just a basic search. I was looking at getting the input box (Maybe as a drop down below like google) to show words either from the card box dictionary or from common words found in the database?

bert

17-Feb-2012 10:50

A Google like search dialog is possible, but not in a macro.
You have to write a separate program for such a function. You need a dialog then that when you type search text direct is looking into the index of Cardbox.

However: for easy search I wrote a simple program that offers you all terms of the index of a field (with a toggle to all terms/search-level available terms).
A kind of search with preview as in Cardbox, but then with checkboxes for selecting one or more terms.
I wrote it because in the search preview of Cardbox a common Windows trick does not work: If you type a character ("s" b.e.) cursor does not move to terms starting with "s". In mentioned search dialog this common windows trick is supported it jumps normal to "s".
Also there is a toggle for selecting of level 0 or search from current level and a toggle for select/exclude.
Also all terms can be copied to the clipboard (with or without "show counts").
If you start the program you can first choose which field you want to search (if you did not directly add it on command line).
Escape always close it.
I wrote it as a experiment. However, I use it more and more because you do not make type mistakes + you find always terms which by Cardbox are offered!
To use it easy I add a pushbuttons to frequent used search fields. In the toolbar a add button to search with field choose dialog. I added also for this a keyboard shortcut.
Not to forget: if you start the program when in edit mode, you get all used terms of the current field listed, when you mark a term, that term is inserted in that field.
I you use more than one Workspace: also supported. Start the program by a macro which start the program and tell in it, the program must be used not to the default workspace, but with THAT workspace. Works in W2k-W7.
I you are interested in it, I can send you a evaluation copy. Email me then at bert.stortenbeker by ns.nl.
regards
bert

Quick Reply

Please log in or register before trying to post a reply.

 
© 2010 Cardbox Software Limited   Home