Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-07-24
10
Medium Priority
?
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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…
Suggested Courses

670 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