Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting ActiveX Vsspell to execute

Posted on 1998-08-02
12
Medium Priority
?
324 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
[X]
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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

705 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