Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Aug 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Underlines in Word for spelling (Word/VBA)

    I've been looking for years to find out how programmatically underline words in Word, the way Word underlines mispellings or grammatically incorrect phrases. I want to use this for certain words, and it would also be great if I could control the color. Any help for any version of Word 2000+ would be great!
    TIA

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

    Re: Underlines in Word for spelling (Word/VBA)

    I don't think that the crinkly underlining for spelling and grammar errors is available to the user, only ActiveDocument.ShowSpellingErrors can be set to True or False.

    But you can set underlining style and color for a range:

    Dim MyRange As Range
    Set MyRange = ActiveDocument.Words(4)
    With MyRange.Font
    .Underline = wdUnderlineSingle
    .UnderlineColor = wdColorRed
    End With

    This will set red single underlining for the 4th word in the document.

  3. #3
    New Lounger
    Join Date
    Aug 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Underlines in Word for spelling (Word/VBA)

    Dude, thanks. That's what I needed.

Posting Permissions

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