Solved

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

Posted on 2014-07-24
10
255 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
My experience with Windows 10 over a one year period and suggestions for smooth operation
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.
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…

707 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

15 Experts available now in Live!

Get 1:1 Help Now