Solved

How to create wavy underlines in Word, as for misspelled words?

Posted on 2014-07-24
10
257 Views
Last Modified: 2014-08-09
Simply, I need to EXACTLY replicate the (red, green) wavy underlines under words in a Word document, exactly as seen when there are some spelling or grammar errors.

I tried ActiveDocument.Words(4).Underline = wdUnderlineWavy
It does do something similar, but it is not an exact replication. This wavy line is differently shaped then Word’s spelling error underline. Moreover, the Word’s spelling error red underline can be at the same time combined with any other underline style (set by user: wavy, single, double…), while wdUnderlineWavy is not, i.e. it is simply one of the standard user formatting underlines, mutually exclusive with wdUnderlineSingle, wdUnderlineDouble for instance…
0
Comment
Question by:npaun
  • 4
  • 4
  • 2
10 Comments
 
LVL 31

Expert Comment

by:Paul Sauvé
ID: 40216902
Have you tried this?Underline
0
 

Author Comment

by:npaun
ID: 40217010
Sorry, I probably should emphasize it more: to do it grammatically, using VB6 or VBA...
0
 
LVL 40
ID: 40218592
Selection.Font.Underline = wdUnderlineWavy

However, do not think of coloring the underline and leaving the text in black. Since there is not way to manually set the underline color to something else than the text color, you cannot do it in code. The underline is part of the font.

The wigglies (that is the name Microsoft gives to those wavy lines) are not part of the text (they are not printed). They are only added by the software itself as an indication that something happens. So no way to duplicate them exactly as they show. wdUnderline is the closest you can get.
0
 

Author Comment

by:npaun
ID: 40218748
Damn...
Is there maybe a way to simulate this by doing something to .SpellingChecked and .GrammarChecked properties? To trick the Word to think that some words are misspelled and show the wigglies?
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 40219370
Oh, sorry. I had never used it so it did not come to my mind, but looking again, I see you can define the underline color.

ActiveDocument.Words(4).Underline = wdUnderlineWavy
ActiveDocument.Words(4).UnderlineColor = wdColorRed

The result is exactly similar to what you get from the spelling checker, except that you will not be able to mix it with other underline types.

What do you want to show with your wavy line? There might be another way to attract the attention of the user. You might want to use some of the Text Effects that are available.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:npaun
ID: 40220505
Well, I have to make a spell-checking add-in for word. It is for a non-english language, and with custom procedures and specific options, so I cannot simply use the built-in spellchecker with a custom non-english dictionary... so I'm in a need to exactly replicate this wiggling feature too...
0
 
LVL 40
ID: 40220527
Microsoft sells language packs for a lot of languages. You might be interested in following that option: http://www.microsoftstore.com/store/msca/en_CA/pdp/productID.247097500?cdid=en%2Dca
0
 
LVL 31

Expert Comment

by:Paul Sauvé
ID: 40220553
What language is your version of Word and what language do you need?

You may find it in File tab -> Options -> Language then click on [Add additional editing languages]LanguagesYou may find that the language you need is in the list...
0
 

Author Comment

by:npaun
ID: 40220557
No, I'm aware that MS offers additional languages, even free in the case I'm interested (Serbian)... but as I said, it is not an option, as the spellchecker I'm working on has to be custom made and has to use a custom, non-Microsoft database of words...
0
 
LVL 40
ID: 40220779
Could you please explain how something that is free and comes from Microsoft is not an option?

I had to work on a custom spelling checker in the 80's. OK, we did not have the kind of processing we have nowadays. But I can tell you that the work required to make something efficient is awesome. And this was in software that I developed myself. Incorporating it inside of something like Word would be even harder, because Word has not been designed in a ways that you can interact with it outside of the object model that Microsoft provided.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

930 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now