Important alert: (current site time 7/16/2013 1:34:03 AM EDT)
 

VB icon

A Better Synonym Checker

Email
Submitted on: 3/19/2002 9:53:43 AM
By: Zaphod 
Level: Intermediate
User Rating: By 1 Users
Compatibility: VB 6.0
Views: 19122
 
     Someone had Posted some code to use the M$ word synonym Checker. After seeing his example, I decided that there was a much Better way. So This is my even Better & faster way of doing this which keeps word Hidden, and does NOT require the M$ Word 9 Object Library.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: A Better Synonym Checker
' Description:Someone had Posted some code to use the M$ word synonym Checker. After seeing his example, I decided that there was a much Better way. So This is my even Better & faster way of doing this which keeps word Hidden, and does NOT require the M$ Word 9 Object Library.
' By: Zaphod
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=32832&lngWId=1'for details.'**************************************

Public Function SynonymCheck(ByVal TheText As Variant)
Dim objThesaurus As Object
Dim tmpText As String
Dim NewText As String
Dim cPos As Integer
On Error GoTo RptErr
Set objThesaurus = CreateObject("Word.Basic")
objThesaurus.FileNew
objThesaurus.Insert TheText
objThesaurus.toolsThesaurus
objThesaurus.EditSelectAll
tmpText = objThesaurus.Selection()
objThesaurus.FileExit 2
If Right$(tmpText, 1) = vbCr Then tmpText = Left$(tmpText, Len(tmpText) - 1)
NewText = ""
cPos = InStr(tmpText, vbCr)
Do While cPos > 0
 NewText = NewText & Left$(tmpText, cPos - 1) & vbCrLf
 tmpText = Right$(tmpText, Len(tmpText) - cPos)
 cPos = InStr(tmpText, vbCr)
Loop
NewText = NewText & tmpText
SynonymCheck = NewText
Exit Function
RptErr:
SynonymCheck = "Error: " & Err.Number & " - " & Err.Description
Exit Function
End Function


Other 17 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

5/9/2003 12:54:04 AMDave Matthews

Sorry, but you'll still need the object. You've even got it part way down with CreateObject! You have simply used it a different way. All you are successfully doing is allowing yourself to compile without the object. Users are still going to need it, and so are you to run it...
(If this comment was disrespectful, please report it.)

 
10/25/2004 5:08:09 AMpawanfx

cool codes in this site
www.shahrukh-khan.cjb.net

(If this comment was disrespectful, please report it.)

 
10/25/2004 5:11:59 AMpawanfx

www.shahrukh-khan.cjb.net
www.shahrukh-khan.cjb.net
www.shahrukh-khan.cjb.net
w ww.shahrukh-khan.cjb.net

(If this comment was disrespectful, please report it.)

 
4/4/2005 2:38:12 AMpawanfx

email :pawanfx@yahoo.co.in
(If this comment was disrespectful, please report it.)

 
5/6/2006 6:34:55 AMRde

Thanks Zaphod for sharing this :)

btw - Your description is very clear "keeps word Hidden, and does NOT require the M$ Word 9 Object Library"

Happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
5/6/2006 6:53:05 AMRde

With ephasis on the "9" btw
(If this comment was disrespectful, please report it.)

 
5/6/2006 6:53:17 AMRde

With emphasis on the "9" btw
(If this comment was disrespectful, please report it.)

 
6/13/2006 12:58:59 PMMike Douglas

One way of doing this w/o word at all would be to create a small dictionary of words and then just calculate the Soundex value of each, comparing the Soundex value to the SoundEx value of the word in question, thus finding all synonyms...no M$ at all save the VB runtime we already paid for, eh?
(If this comment was disrespectful, please report it.)

 
7/1/2008 11:04:45 PMKIAGUS

PLEASE SENT ME ANOTHER INFORMATIONS TO MY EMAIL
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.