Ok, I originally posted this in the VB forum but did not get any response, so hopefully some of you C/C++ guys know the answer

When using the RichTextBox ActiveX control (which is based on RichEdit 1.0) that comes with VB, the SelBold property returns one of three values:

True - ALL of the selected text is bold
False - NONE of the selected text is bold
Null - Some of the selected text is bold, some is not.

Now, on to the problem:
I can't figure out how to tell if some, but not all, of the selected text is bold. I have the following code:


VB Code:
  1. Dim cf As CHARFORMAT2
  2. Dim selBold As Boolean
  3.  
  4. cf.cbSize = Len(cf)
  5. cf.dwMask = CFM_BOLD
  6. SendMessage hWndRichEd, EM_GETCHARFORMAT, SCF_SELECTION, cf
  7.  
  8. selBold = ((cf.dwEffects And CFE_BOLD) = CFE_BOLD)


This will only give me a true or a false...any ideas on how to determine if some, but not all, of the selected text is bold????

BTW, hWndRichEd is the handle to a richedit 2.0 window that I created via CreateWindowEx and is not an ActiveX control.

Thanks