Solved

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

Posted on 2014-07-24
10
261 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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
 

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

770 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