Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

vba that simplifies the vocabulary in an MS Word document

Posted on 2013-01-16
8
Medium Priority
?
476 Views
Last Modified: 2013-01-27
I often need to downgrade information in articles so that my students can understand them. I know there is a synonym feature in ms word when you write click a word but its a bit in convenient because it is necessary to move the mouse 3 times is it possible to either
             1.creat a macro that on a rightclick only displays a list of synonyms
              2.create a macro that provides only synonyms on a lower reading level
0
Comment
Question by:Dov_B
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 38786146
Hi,

Do you want to replace the normal contextual menu  or re-arrange it

Regards
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 1000 total points
ID: 38787040
The list of synonyms isn't rated in any way, so you would have to decide for yourself what you consider to be a most suitable for your students.

This demonstrates how to get the synonym list with VBA:
Sub ListSynonyms()
    Dim synInfo As SynonymInfo
    Dim vList() As String
    Dim i As Integer
    Dim strMessage As String
    Dim m As Integer
    Set synInfo = Selection.Range.SynonymInfo
    For m = 1 To synInfo.MeaningCount
        strMessage = strMessage & vbCrLf & "*** Meaning no: " & m & _
        "(" & GetPartOfSpeech(synInfo.PartOfSpeechList(m)) & ") ***" & vbCrLf
        vList = synInfo.SynonymList(m) 'Meaning:=2)
        For i = 1 To UBound(vList)
            strMessage = strMessage & vList(i) & vbCrLf
        Next i
    Next m
    MsgBox strMessage
End Sub

Function GetPartOfSpeech(wdpos As Variant) As String ' wdpos As WdPartOfSpeech give a TypeMismatch error
         Select Case wdpos
            Case wdAdjective
                 GetPartOfSpeech = "adjective"
            Case wdNoun
                 GetPartOfSpeech = "noun"
            Case wdAdverb
                 GetPartOfSpeech = "adverb"
            Case wdVerb
                 GetPartOfSpeech = "verb"
            Case Else
                 GetPartOfSpeech = "other"
        End Select
End Function
0
 

Author Comment

by:Dov_B
ID: 38799427
I am very sorry it took so long to get back to you. Thanks ever so much for kindly sharing your expertise with me. Is it possible to get that synonym list into a contextual menu generated by a right click which replaces the normal right click shortcut menu? I don't like the normal right click menu because it requires three clicks for me to choose the replacement synonyms. Although I may appear to be slightly lazy, when you consider that I am processing a huge amount of words to be simplified with easier synonyms every click counts
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 1000 total points
ID: 38800770
We could add an item to the context menu, with some code like this:
Sub ContextSub()
    Dim cb As CommandBar
    Dim cbb As CommandBarButton
   
    CustomizationContext = NormalTemplate
    Set cb = CommandBars("Text")
    Set cbb = cb.FindControl(Tag:="List Synonyms")
    If cbb Is Nothing Then
        Set cbb = cb.Controls.Add(Type:=msoControlButton, _
            Before:=9, Temporary:=True)
       
        With cbb
            .Caption = "&List Synonyms"
            .Tag = "List Synonyms"
            .OnAction = "ListSynonyms"
        End With
    End If
End Sub

Open in new window

but, at best, that wouldn't save you any clicks. To do that, we would need at add each synonym to the context menu, with the OnAction set to a macro for that particular synonym.

Perhaps it would be better to use Find and Replace instead.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38800894
Another suggestion is to use an Exclusion dictionary. Words in such a list will be flagged as spelling errors even though they are, in fact, spelt correctly. Then when you find the first instance, you can type in the simpler word and select Change All.
0
 
LVL 53

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 1000 total points
ID: 38808830
Hi,

I've created a template file, that you can use, as an add-in, to solve your problem.

Please put this file in your startup folder
ReplaceWithSynonym.dot

(how-to here: http://word.tips.net/T001602_Folder_Locations_for_Add-Ins.html)

To toggle between SynonymSearch state and normal context menu, use Alt-Strg-A

if you want to re-fire the macro (after a macro bug, for example), use Alt-Strg-Y

Please tell me your Word version, if you want help to use the template as an add-in.

http://office.microsoft.com/en-us/powerpoint-help/view-manage-and-install-add-ins-in-office-programs-HA010354315.aspx
WordAddInsThere select "Word Add-Ins" Go...

Then by Global Templates and Add-Ins you have to add the template

Regards
0
 

Author Comment

by:Dov_B
ID: 38824302
Dear Grahamskan and Rgonzo1971 you are angels may you be blessed with everything Good!
0
 

Author Closing Comment

by:Dov_B
ID: 38824311
Yes I wish I could both of you more points
I can never figure out how to ask a related question I would like to work on this project by asking related questions in any event it puts your synonims into one column which smetimes goes beyond the length of the screen How can Iget the shortcut menu to break up the words into multiple columns?
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you ever need to create a 20 page Word document for some testing purpose? Are you tired of copying & pasting old boring "lorem ipsum" text over and over again, increasing font size and line space in order to make the document 20+ pages long? Look…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question