Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Spellcheck RTF
Message
 
To
17/01/2003 06:57:02
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00726083
Message ID:
00742816
Views:
25
Hi Alan,

Thanks for the information. I finally gave up with FoxSpell and purchased the Chado SpellEditor, www.spelleditor.com. From what I have seen through my initial use, it is a really nice control that spell checks RTF.

Thanks,

TFISHER

>Hi Terry,
>
>The loss of formating seems to occur when the complete text of the RTF control is replaced in a single step.
>
>I don't have your spell checker, so I don't know if its practical to submit one word at a time for checking. The performance may also be too poor for this approach.
>
>If it is feasible to follow this route, then some formatting can be maintained using code similar to that below. The RTF control is named olecontrol1 and bound is to a memo field.
>
>For my test I have misspelled 'format' as 'firmat'
>
>The code fails to maintain formatting if the format is changed mid word, as the initial format gets applied to the whole word.
>
>Sorry about the EXIT in the DO loop but I'm just off out.
>
>Hope this helps.
>
>Alan
>
>******************************************
>ThisForm.olecontrol1.selStart = 0 && Start work at position 0
>ThisForm.olecontrol1.selLength = 1 && Number of selected characters
>
>DO WHILE .T.
>
> * Check if selected text is a complete word,
> * i.e. it is terminated by space or is the last word available
> IF RIGHT(ThisForm.olecontrol1.selText,1) = ' ' OR;
> ThisForm.olecontrol1.selLength + ;
> ThisForm.olecontrol1.selStart =;
> LEN(ThisForm.olecontrol1.text)
>
> * A word has been found. Check the spelling.
> lcWord2Check = ThisForm.olecontrol1.selText
> IF lcWord2Check = 'firmat '
> lcWord2Check = 'format '
> ENDIF
>
> * Place word back in RTF control
> ThisForm.olecontrol1.selText = lcWord2Check
>
> * Check for end of job
> IF ThisForm.olecontrol1.selStart = LEN(ThisForm.olecontrol1.text)
> EXIT
> ENDIF
>
> ELSE
>
> * Increase length of selected text
> ThisForm.olecontrol1.selLength = ThisForm.olecontrol1.selLength + 1
>
> ENDIF
>
>ENDDO
Thanks,

TFISHER
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform