Page 1 of 2

Text grammar check by Word's spelling

Posted: Tue Apr 11, 2017 7:43 pm
by Pablo César
Hi everybody,

Putting automation to work. More once again, the technology that holds the whole thing together is COM (Component Object Model) or Common Object Model which specifies ways for applications to work together, incorporating the OLE/ActiveX.

I made this demo with the intention to illustrate how many options we have together with Harbour + HMG + VBA.
Screen179.png
Screen179.png (18.11 KiB) Viewed 5217 times
 
Based on the demo that bpd2000 posted, thanks Dave for showing me the way and serving as a source of inspiration.
SpellCheck.rar
Source files
(2.91 KiB) Downloaded 268 times
Demo1_Exe.rar
Executable file
(1.22 MiB) Downloaded 262 times
 
And sincerely I hope that it will inspire others as well and even more with other custom dictionary inclusively options.

For be fun and instructive at the same way... :P

Re: Text grammar check by Word's spelling

Posted: Tue Apr 11, 2017 7:52 pm
by serge_girard
Great work Pablo!

With suggestions it works, but without it get hung up!
WINWORD.EXE has started but nothing happens and all functions are blocked.
I use W7-32bits and ran your DEMO1.EXE. This was also the case with the first demo.

Serge

Re: Text grammar check by Word's spelling

Posted: Tue Apr 11, 2017 8:01 pm
by serge_girard
Ooops... I was mistaken by the Word Window hidden underneath all other window-forms. Sorry Pablo, I didn't expect this behaviour!
It works just great!

Serge

Re: Text grammar check by Word's spelling

Posted: Tue Apr 11, 2017 8:06 pm
by Pablo César
Thank you Serge.
Ooops... I was mistaken by the Word Window hidden underneath all other window-forms. Sorry Pablo, I didn't expect this behaviour!
It works just great!
It's allright Serge.

I was preparing this text for your previous message. Now happy to know it was that the reason...
I'll let this message like this, probably others could it happen the same.
With suggestions it works, but without it get hung up!
Suggestions, It just to ilustrate. The rest could be done better for sure: replacing, stop, etc...
WINWORD.EXE has started but nothing happens and all functions are blocked.
In this case you would make manually focus on WINWORD, I guess. It happen to me too. Try wih ALT TAB and look up for Word.

That's cound be improved with SearchWindow function and Restore/SetForegroundWindow/BringWindowToTop WINWORD's Window.
These function you can find at my PrintFile project ( at this topic )

Sorry Serge, but I do not wish to spend more time with Word spelling engine...

Certainly, there are many other ways to do better than by WinWord.

Re: Text grammar check by Word's spelling

Posted: Tue Apr 11, 2017 8:11 pm
by serge_girard
Sure, I understand it was just 'nice-to-have'!

Serge

Re: Text grammar check by Word's spelling

Posted: Wed Apr 12, 2017 4:00 am
by bpd2000
Hi Pablo
Thank you for such nice creation
Is there any way to bring Activex/Object Window on Top
I full agree with observation of Serge, that program is hang up!

Re: Text grammar check by Word's spelling

Posted: Wed Apr 12, 2017 12:12 pm
by Pablo César
Is there any way to bring Activex/Object Window on Top
Did you mean: bring on TOP the WinWord, instead ?
I full agree with observation of Serge, that program is hang up!
Please try to explain some more about "hang up" you referring to.
I am not understanding what it is hanging up... :?

Are you referring to the hiden window of WinWord ?
In case: it seems to be hang up, but it behind...

Re: Text grammar check by Word's spelling

Posted: Wed Apr 12, 2017 3:56 pm
by Pablo César
Hi Dave, you said "Hang up" but did not specied how...

Now I understand Claudio how he feels when all saying: IDE is "crashing" (myself I am including)... :oops: (sorry Claudio for that)

Sometimes users have no other way to define what and when something it is going wrong.
But it essential to understand what is exactly happening... poor info, hardest work for programmer to identify the problem. :mrgreen:

This is a very old matter, if what I suppose to be your case: how to get focus at Word's child window (spelling window).
See at internet many discussions about it.

I said in my previous message to Serge it could be implemented the SearchWindow function... but it's not easy and right.

This SearchWindow function works with real title of window and this can differs by other reasons: Word version, local language...

I got a reasonable result but I think is not the best way to do garantee the focus.
I've took mixed examples: IsExeRunning2 + SearchWindow with the difference it must be for CHILD window.

I also believe that Word spelling engine it's not the best way to check for control's speeling grammar check.
Sorry to say but I do not wish to spend more time in this... I would like to have our own spelling check.

I think my second option (suggested items) it's more practical and faster.

So test it and tell me if is working properly. For me It's ok here...
SpellCheck.rar
Source files only
(3.24 KiB) Downloaded 250 times
 
Gimme a return, please.

Re: Text grammar check by Word's spelling

Posted: Wed Apr 12, 2017 4:33 pm
by serge_girard
Thx, Pablo ! It is OK

I think BPD had the same 'problem' as I had. BPD: push 'clear desktop' and activate spellchecker and you'll see it worls.

Re: Text grammar check by Word's spelling

Posted: Wed Apr 12, 2017 4:52 pm
by bpd2000
Hi Pablo
I am on tour and can test after 2 days when I return to my office
Some time user can not explain properly the correction situation / may be in hurry when replying.