View Single Post
  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default how to change color of wavy red spell check lines

Hi Tony,

You're precisely correct. I've now tried the same support.dot template in both
2003 and 2007, with and without pre-existing entries. When it runs from 2003,
the PrivateProfileString creates a REG_DWORD; when it runs from 2007, the same
code creates a REG_SZ. If there's a REG_DWORD there already, it's overwritten
with a REG_SZ.

When the value is a REG_DWORD, it works properly in both versions; when it's a
REG_SZ, the underline stays red. I suppose it's some consolation that Word
simply ignores a REG_SZ instead of throwing an exception. ;-)

I haven't been able to find any description on the web of this change in
PrivateProfileString's behavior (unless it's in one of the many non-English
items that Google turned up). Interestingly, the help for it has always said
that it writes a "string", so I guess it's a little surprising that it ever
wrote a DWORD.

The fix would have to involve use of the RegSetValueEx function of the Win32API,
which lets you specify the value's type; and that in turn would need
RegOpenKeyEx and RegCloseKey. It isn't terribly difficult if you're used to API
programming.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.

On Fri, 30 May 2008 00:31:24 +0100, "Tony Jollans" My forename at my surname
dot com wrote:

The problem is that the template writes a string value (REG_SZ) to the
registry when it needs to be a doubleword (REG_DWORD). It seems to be a
change in the behaviour of PrivateProfileString in 2007.

--
Enjoy,
Tony

"Jay Freedman" wrote in message
...
I just scrounged up a copy of the Support.dot template from Word 2003 and
tried it in Word 2007. It does _not_ appear to be broken, at least with
respect to the spelling underline color -- except that it stores the
decimal value of the RGB color in the registry, while the 925597 article
says it should be hexadecimal.

However, following the instructions in the 925597 article, the wavy
underline stayed red regardless of what value I put into the registry
entry. So maybe the whole mechanism is broken. I haven't yet put any
effort into trying the other settings... something for a rainy afternoon,
which we've been promised for the coming weekend. :-(

Tony Jollans wrote:
Thanks, Jay,

I wonder why they broke it in the first place (or have they fixed a
bug it previously relied on?). Is it documented anywhere?


"Jay Freedman" wrote in message
...
For Word 2007 the article http://support.microsoft.com/kb/925597
explains what to do in the registry.

It seems to me it would have been friendlier to make sure the support
template's macro got updated, but I'm just a code monkey. :-)

Tony Jollans wrote:
See http://support.microsoft.com/kb/284845

That article is for Word 2002. It still works in Word 2003 - but
doesn't in Word 2007 (although the underlying registry changes
should still have effect)


"parkay96" wrote in message
...
Currently using Word 2003 SP3.
Wanting to know if able to change color of wavy red line that
appears under
misspelled words?