Solved

Getting ActiveX Vsspell to execute

Posted on 1998-08-02
12
314 Views
Last Modified: 2010-04-04
I have a built a mini text editor and wish to incorporate the spell checker. I am using Delphi 3, Windows 95. Coding sequence is unkown. Sample is being sought. Sam's text supplied with Delphi 3 has  none  and neither have I discovered any on the internet.

Thanks, Delphi3
0
Comment
Question by:delphi3
  • 6
  • 6
12 Comments
 
LVL 4

Accepted Solution

by:
BoRiS earned 60 total points
Comment Utility
delphi3

the helpfile is in the

but just use this..

procedure TForm1.Button1Click(Sender: TObject);
begin
 VSpell1.CheckText = Edit1.Text;
end.

if you need more help just leave a comment...

Later
BoRiS
0
 
LVL 4

Expert Comment

by:BoRiS
Comment Utility
delphi3

sorry the help file is in ...Borland\Delphi3\Ocx\Vci\Vspell\Vsocx.hlp

Later
BoRiS
0
 
LVL 4

Author Comment

by:delphi3
Comment Utility
Good job BoRiS,

I didn't know that  Ocx\Vci\Vspell\Vsocx.hlp   was available. In my situation, for your sample provided, I needed to rewrite the code  to the procedure.

procedure TForm1.Button3Click(Sender: TObject);
begin
     VSspell1.CheckText := Memo1.Text;
end;

It works fine to launch the spell checker, it discovers the error in a line of text, makes suggestions,  but makes no change in the text when pressing the Replace button on the spell check form supplied. One more thing to discover why it does not work beyond this.

 I sincerely thank you,

Delphi3
0
 
LVL 4

Expert Comment

by:BoRiS
Comment Utility
delphi3

have you tried the ReplacementWord property...

VSpell1.ReplacementWord = TextBox.Text
VSpell1.ReplaceLastWord = True

Later
BoRiS
0
 
LVL 4

Author Comment

by:delphi3
Comment Utility
BoRiS,

I tried, as referenced in theOcx\Vci\Vspell\Vsocx.hlp,  and  before you I read your solution, with modifications :

procedure TForm1.Button3Click(Sender: TObject);
begin
     VSspell1.CheckText := Memo1.Text;
     If VSspell1.ReplaceOccurred Then
          Memo1.text := VSspell1.Text
end;

 This above works fine but I will try yours too (after I Change VSpell1 to VSspell1, of course, so that my version of Delphi 3 can read it).

And A BIG THANKS,
Delphi3
0
 
LVL 4

Author Comment

by:delphi3
Comment Utility
Adjusted points to 60
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 4

Author Comment

by:delphi3
Comment Utility
BoRiS,

Seems like there is always just one more thing. The VsSpell checker does its job. Is there a means to have the word it is looking at, that is, the  mispelled word  be highlighted in the text? I have looked in the help referenced earlier and see the highlighting is  not in one of the options or just maybe I am not calling it by the correct name.


0
 
LVL 4

Expert Comment

by:BoRiS
Comment Utility
delphi3

when you say the mispelled word do you mean in the memo or in the vspeller textbox...

Later
BoRiS
0
 
LVL 4

Author Comment

by:delphi3
Comment Utility
BoRiS,

Thanks for the reply.

 When the VsSpell finds WordOneMisSpelled in the Memo1Box,  that my code interrupt VsSpell after having made the discovery,  and instruct it to higlight WordOneMisSpelled in  the Memo1TextBox, prior to my accepting or rejecting the VsSpell choice of words for the change. I  then press the Replace button on VsSpell, the code returns the text color of WordOneChanged  to a color state of  all Memo1Text. Then on to the next word, highlight WordTwoMisSpelled in the Memo1TextBox, and so on.

I did try using  other code as I could find in the examples provided but it only listed the line and the character number of the very last event that VsSpell found in error. That was of no use as as I may have had  more that one mistake and it is really not what I am searching for anyway.

Thanks,

Delphi3


0
 
LVL 4

Expert Comment

by:BoRiS
Comment Utility
delphi3

I'll check it out for you and let you know...

Later
BoRiS
0
 
LVL 4

Expert Comment

by:BoRiS
Comment Utility
delphi3

I'll check it out for you and let you know...

Later
BoRiS
0
 
LVL 4

Author Comment

by:delphi3
Comment Utility
BoRiS,
I have worked out the solution.  I could share it with you. The main structure to implement a highligted error and the immediate replacement of that error in the original text with the changed word   has to do with the VsSpell1 event: onMisspelled, to include a call to SetFocus and  a  call for an update while VsSpell is locating the next error. The other  change is  to  set an item in the object inspector, referencing Memo1:HideSelection from true to false.

Delphi3

Hope that makes sense:
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now