Results 1 to 15 of 15
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need to proof word by word in highlighed block (Word 2003)

    Hi,

    I'm doing a lot of proofreading. Actually the text generated from Voice Recognition software (Dragon Naturally Speaking Professional 8.0.

    End product is a Word doc. I relisten to original dictation and have to scroll through the text, looking for errors and making corrections. It's pretty hard going and very easy to miss things. I'm after software or the know-how to create a feature whereby I could use the Ctrl+arrow to jump word to word, but I'd like it highlighted (yellow if possible) so that each word is very clear and word recognition errors will be much harder to miss.

    Any ideas!

    Cheers,

    ozgal

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    You could copy the following macro into a module in Normal.dot:

    Sub SelWordRight()
    Selection.Range.HighlightColorIndex = wdNoHighlight
    Selection.Collapse Direction:=wdCollapseEnd
    Selection.MoveRight Unit:=wdWord, Extend:=wdExtend
    Selection.Range.HighlightColorIndex = wdYellow
    End Sub

    and use Tools | Customize..., Keyboard to assign it to the Ctrl+Right arrow keystroke. You can modify the highlight color wdYellow (the macro leaves the word selected, so you'll see blue instead of yellow)

    * Warning * : This macro is not ideal. If you move to another location by any other means than Ctrl+Right arrow, the word will remain highlighted. And if you move to a word that was already highlighted, the original highlighting will be overridden.

  3. #3
    Star Lounger
    Join Date
    Sep 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    Hello Hans,

    A very big thank you for the macro. I have followed your instructions and it all works well. I did make one small change and that was to assign the macro to a hot key other than Ctrl+Right arrow keystroke so I would still have normal functionality within word.

    While the macro works well, as you point out, it is very easy to delete text inadvertently if not careful about cursor movement.

    Can I ask a further favour? I would actually prefer a method whereby each word is highlighted separately not continuously, which happens with the current macro (or by using the Ctrl-right/arrow combination. Just by double clicking with the mouse in a word that words is highlighted but not attached to the next word. Would it be possible to have a series of these moves to fashion a mock highlighting of single words so they stand out separately.

    Here's what I'd like, but I'm not sure I can emulate the mouse key double click when trying to create a macro. Unfortunately I do not have VBA knowledge and can only record macros or paste them in when provided by those with that knowledge, such as yourself.

    Here's what I'm trying to do:

    type a few words on a page so you have something to work with.

    Then start the macro:

    double click in the first word and it will be highlighted, then press the right arrow key so it sits in the next word, double click the mouse again and that word is highlighted. Then I will assign that macro to a hot key of my choosing at this end.

    Is this feasible?

    For the life of me I've searched high and low on the internet for software or add in to Word that will do this and have had no luck.

    Thanks for any help you may be able to offer and for your patience and kind help so far.

    Cheers,

    ozgal

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    If you leave the Highlighting out of HansV's macro then you get this
    <code>
    Sub SelWordRight()
    Selection.Collapse Direction:=wdCollapseEnd
    Selection.MoveRight Unit:=wdWord, Extend:=wdExtend
    End Sub
    </code>
    Does it do what you want?

    StuartR

  5. #5
    Star Lounger
    Join Date
    Sep 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    Hi Stuart,

    Thanks so much. Yes, this works better. It still does not highlight each word individually but once I stop pressing the macro key (I've assigned Ctrl+number 1 on numeric keypad) I just press right cursor key and highlighting stops, which is great. I suppose I'm being just a bit too fussy wanting each word highlighted without being connected to any words either side. Just having the highlighting coming up now is such a bonus, compared to only having the skinny text selector bar when using Ctrl +right arrow on its own.

    Many thanks to both yourself and Hans for helping me out.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    I don't really understand what you want. Does the following help? It highlights individual words within the currently selected text.

    Sub HiliteWords()
    Selection.Range.HighlightColorIndex = wdYellow
    With Selection.Find
    .Text = " "
    .Replacement.Text = " "
    .ClearFormatting
    .Replacement.ClearFormatting
    .Replacement.Highlight = True
    .Wrap = wdFindStop
    .Execute Replace:=wdReplaceAll
    End With
    End Sub

  7. #7
    Star Lounger
    Join Date
    Sep 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    Hi Hans,

    I'm most likely not explaining myself very well.

    Thank you for the second macro. I installed it and highlighted the entire document (consisting of 10 sections, each containing a separate letter). When I ran the macro (and pressed my hot key a couple of times) it highlighted the whole document, with each word now yellow. Is that what you intended it to do?

    If we go back to the macro Stuart has included above, could you try it out in a word document. If you assign it a hot key like I have done and press that hot key a few times you will see the words highlighted one by one to the right. They are still joined (as they were in your first macro) but when I press the right arrow key on its own everything returns to normal. This is actually what I want as I am proofing the document and would like each word to come up as I skim across the line. At the same time I am listening to dictation of what I have typed. By using my hotkey (incidentally this is Ctrl+number 1 on numeric keypad) my eyes and ears are working in tandem and any errors are much easier to spot than simply reading the screen without any highlighting.

    The only other thing I was hoping to have was that as I read across the line and execute the macro each word would be highlighted individually rather than all coming up as a running block. But this not all that important and perhaps just sticking to Stuart's macro will be fine as it is.

    I hope I have not confused you too much as I know you are very, very well versed with macros and I'm a total novice. My apologies if I've not been clear enough with my explanations.

    I really appreciate both yours and Stuart's help. Thank you so much.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    My second macro was clearly not what you intended, so forget about that.

    Word's macro language does not support selecting discontiguous (non-connected) pieces of text, so I guess Stuart's macro is the best you can do.

  9. #9
    Star Lounger
    Join Date
    Sep 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    Hello Hans,

    Sorry for the delay in getting back to you. My birthday today...! Thank you for your help - and yes, I agree, Stuart's macro will do the trick.

    Cheers and all help much appreciated.

  10. #10
    Star Lounger
    Join Date
    Sep 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    Hi Hans and Stuart,

    An update on the macro. Another macro whiz from www.productivity.com was kind enough to create this macro for me, which does exactly what I was after. I'd thought you would both like to see it. In addition another posted noted that selecting noncontiguous text is a new feature in Word 2003. You hold down on the Ctrl key while selecting only the text you want highlighted.

    Try out this macro:-


    Assign any shortcut to this macro. I suggest assigning Alt + Ctrl + Right Arrow.

    Each press of the shortcut will highlight the next word in yellow. If you do this to the end of the document, no colored words will remain; however, if you stop before reaching the end, one word will be colored. To remove any remaining color, press Ctrl + End then press your shortcut.


    CODE

    Sub ColorWordRight()
    'By Ed Weber
    'Assign a shortcut of your choice; Alt +Ctrl +Right Arrow is suggested.
    'Press the shorcut to color the current word and move the selection
    'to the next word.
    'To clear any leftover color, press Ctrl + End then press the shortcut
    ActiveDocument.range.Font.Shading.BackgroundPatter nColor = wdColorAutomatic
    Selection.Words(1).Font.Shading.BackgroundPatternC olor = wdColorYellow
    Selection.Move unit:=wdWord, Count:=1
    End Sub

    (P.S. I have assigned Ctrl+number 3 on numeric keypad as a shortcut for the macro) and I just press Ctrl-Z to end the colouring once I'm finished proofing).

    Cheers to you and thanks again for your help,

    ozgal

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    Thanks for sharing. On my PC, t does more or less the same as my original macro - it selects a word with the space following it.

    Selecting discontiguous text was introduced in Word 2002. There is no support for it in VBA, however.

  12. #12
    Star Lounger
    Join Date
    Sep 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    (Edited by HansV (twice) to make URLs clickable - see <!help=19>Help 19<!/help>)

    Hi again Hans,

    Yes it is similar to your first macro. I now have a choice of three macros to try, assigned to Ctrl+1 on numeric keyapd, Ctrl+2...., and Ctrl+3.... Should keep me happy for a while.

    I'm very much indebted for all the help I've received.

    BTW, I do medical transcription and am always on the hunt for tools to increase my productivity. An interesting site that also has macros and productivity tips is http://www.productivitytalk.com. They are always on the lookout for those able to offer macro expertise or tips on increasing productivity in general.

    Here's a lnk to my post on that site about this macro.

    http://www.productivitytalk.com/forums/ind...t=0#entry639093

    Again, thanks for everything.

  13. #13
    Star Lounger
    Join Date
    Sep 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    Hi again,

    Although this was an old post, I'm wondering if there is a way to modify the macro, just changing it from one word being highlighted to five words, with everything else staying the same.

    Any chance someone can point me in the right direction?

    Cheers and thanks so much.

  14. #14
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    <P ID="edit" class=small>(Edited by jscher2000 on 30-Oct-08 23:06. Changed the end-of-document test.)</P>If I understand your current code and your new requirements, this should do it:

    <code>Sub ShadeFiveWords()
    ' Clear all shading in document (carried over from previous procedure)
    ActiveDocument.Range.Font.Shading.BackgroundPatter nColor = wdColorAutomatic
    ' Shade up to five words (do not extend past end of paragraph)
    Dim intCount As Integer
    With Selection
    ' Position insertion point next to a non-space, non-para break character
    While .Text = vbCr Or .Text = " "
    .MoveEnd Unit:=wdCharacter, Count:=1
    ' Quit if at end of body
    If Selection.End >= ActiveDocument.Content.End - 1 Then Exit Sub
    Wend
    ' Extend selection to next space (then repeat up to 4 times)
    For intCount = 1 To 5
    .MoveEndUntil Cset:=" " & vbCr, Count:=wdForward
    If .Next.Text = vbCr Then
    Exit For
    ElseIf intCount < 5 Then
    .MoveEnd Unit:=wdCharacter, Count:=1
    End If
    Next
    ' Apply yellow shading
    .Font.Shading.BackgroundPatternColor = wdColorYellow
    ' Position insertion point at the end of the shading
    .Collapse Direction:=wdCollapseEnd
    End With
    End Sub</code>

  15. #15
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Need to proof word by word in highlighed block (Word 2003)

    Actually, if you want the words highlighted but not the spaces (reading further up the thread), you could try this one:

    <code>Sub ShadeFiveWordsWithoutSpaces()
    ' Clear all shading
    ActiveDocument.Range.Font.Shading.BackgroundPatter nColor = wdColorAutomatic
    ' Shade up to five words (do not extend past end of paragraph)
    Dim intCount As Integer
    With Selection
    ' Position insertion point next to a non-space, non-para break character
    If SkipSpaces Then Exit Sub
    ' Extend selection to next space (then skip the space and repeat up to 4 times)
    For intCount = 1 To 5
    .MoveEndUntil Cset:=" " & vbCr, Count:=wdForward
    ' Apply yellow shading
    .Font.Shading.BackgroundPatternColor = wdColorYellow
    ' Check next character
    If .Next.Text = vbCr Then
    Exit For
    ElseIf intCount < 5 Then
    If SkipSpaces Then Exit Sub
    End If
    Next
    ' Position insertion point at the end of the shading
    .Collapse Direction:=wdCollapseEnd
    End With
    End Sub

    Function SkipSpaces() As Boolean 'True means quit
    SkipSpaces = False
    With Selection
    If Not (.Type = wdSelectionIP) Then .Collapse Direction:=wdCollapseEnd
    While .Text = vbCr Or .Text = " "
    .MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    ' Quit if at end of body
    If Selection.End >= ActiveDocument.Content.End - 1 Then
    SkipSpaces = True
    End If
    Wend
    End With
    End Function</code>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •