Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Getting ActiveX Vsspell to execute

Posted on 1998-08-02
12
321 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
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Form ownership 4 111
How to load 2 images in same column in Delphi 2 57
DBCtrlGrid, Delphi, Scroll 8 37
shape, triangle, dbctrlgrid 3 17
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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