Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Getting ActiveX Vsspell to execute

Posted on 1998-08-02
12
Medium Priority
?
325 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 240 total points
ID: 1359549
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
ID: 1359550
delphi3

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

Later
BoRiS
0
 
LVL 4

Author Comment

by:delphi3
ID: 1359551
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Expert Comment

by:BoRiS
ID: 1359552
delphi3

have you tried the ReplacementWord property...

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

Later
BoRiS
0
 
LVL 4

Author Comment

by:delphi3
ID: 1359553
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
ID: 1359554
Adjusted points to 60
0
 
LVL 4

Author Comment

by:delphi3
ID: 1359555
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
ID: 1359556
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
ID: 1359557
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
ID: 1359558
delphi3

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

Later
BoRiS
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1359559
delphi3

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

Later
BoRiS
0
 
LVL 4

Author Comment

by:delphi3
ID: 1359560
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

885 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