Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-07-24
10
Medium Priority
?
298 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 33

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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

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 1000 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
 

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 33

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Quickbooks hosting can do wonders to your enterprise but considering the points elaborated in the article which will help you to better analyze the outcomes. So scan your business, its needs and then move to the new world of limitless benefits.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

963 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