Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 11th, 2006, 01:26 AM
SMI SMI is offline
Authorized User
 
Join Date: Jul 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Urgent: Finding meanings of a word using VBA

Hi
I have a 27 pages document/listing of frequently used words that helps students to enrich their vocabulary skills. My objective is to put available meanings in front of each word using Word VBA. Note these are around 5021 words using 5021 lines.

If a particular word is not in the default dictionary, then the loop should skip that word without giving an error message.

I have experience with Excel VBA but a completely ignorant person in Word VBA. I would appreciate getting most urgent response on this.


Thank
SMI

Genius is 99% perspiration and 1% inspiration
__________________
Genius is 99% perspiration and 1% inspiration
 
Old September 11th, 2006, 04:32 AM
SMI SMI is offline
Authorized User
 
Join Date: Jul 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
Using help of Word VBA, I have been able to deploy the following code that is giving me the list of synonymns of my selected word. However, since there are more than 5000 lines in my document, I need to make a loop which could check each line and put the meanings of that word if available, otherwise put "----" if the word in not found in cutom dictionary.

So I need help from you guys to make such loop. Please help. I am more than half way done with script and your little help will give it a final go.

Sub MakeSynonyms()
Set mySyn = Selection.Words(1).SynonymInfo

If mySyn.MeaningCount <> 0 Then
    myList = mySyn.MeaningList
    Selection.EndKey Unit:=wdLine
    Selection.TypeText Text:=" ("
    For i = 1 To UBound(myList)
        Selection.TypeText Text:=myList(i) & " ,"
    Next i
    Selection.TypeText Text:=")"
Else
    Selection.EndKey Unit:=wdLine
    Selection.TypeText Text:=" ----"
End If


End Sub

Genius is 99% perspiration and 1% inspiration
 
Old March 26th, 2007, 08:13 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi SMI

Could you please forward that file containing descriptions to all VBA codes. I was in search in internet for such codes vocabulary but could not succeed. If you can, could you please send it to [email protected]

Thanks very much.






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to finding the Graphic objects in word doc madhan_needs_help Word VBA 2 August 8th, 2007 10:38 AM
URGENT! run ms word semooth Access 3 February 3rd, 2004 07:06 PM
Word VBA sdowen Excel VBA 4 December 3rd, 2003 04:32 PM
VBA Word gcookie79 Excel VBA 1 November 12th, 2003 01:04 PM
Finding a heading in a word document nesplb Pro VB 6 1 August 18th, 2003 04:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.