|
-
Jan 13th, 2006, 03:34 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] RobDogs Spellcheck with array ?
Guys & RobDog !
I am using RD's .net spell checker and it is working sweet as a nut. But I was wondering if it would be possible to make a slight adjustment.
My problem at the moment is that I have around 15 different screens that need to use this, each screen could have upto 5 textboxes that need to be checked.
So, I have the SpellCheck code in a dll, and reference it each time I need to perform the check using something along the lines of.....
VB Code:
Public Sub Spell()
Try
'Get New instance of PWBSpell.dll
Dim Spell As PWBspell.clsSpellMe = New PWBspell.clsSpellMe
'Perform SpellCheck
tb_NTCComments.Text = Spell.SpellMe(tb_NTCComments.Text)
tb_NTCSubject.Text = Spell.SpellMe(tb_NTCSubject.Text)
Catch ex As Exception
EH.Log(ex)
End Try
End Sub
Where tb_.... are the textboxes to check.
Because the number of items to check on each screen varies, I am running the SpellMe function multiple times (Twice in this eg). Would it not be possible to send a string array to the function, SpellMe could run through each item in the array, then return a new array containing the corrected values ? Or is what I am doing now the best method.
Thanks in advance, and thanks again to RobDog for another fantastic bit of code.
Bob
"I dislike 7 am. If 7 am were a person, I would punch 7 am in the biscuits." - Paul Ryan, DailyRamblings
-
Jan 13th, 2006, 03:39 AM
#2
Re: RobDogs Spellcheck with array ?
Thaks I'm glad you like it. 
You could concatinate the textboxes and perform a spellcheck on the entire string. The hard part will be knowing how to split it back to your textboxes with having a delimiter that doesnt invoke a misspelling or grammer issue.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 13th, 2006, 03:46 AM
#3
Thread Starter
Fanatic Member
Re: RobDogs Spellcheck with array ?
Thanks RD, s'pose the concatinate thing could work, but like you said its going to be difficult separating the strings without giving problems.
Anyway, its working just fine as it is ta.
Bob
"I dislike 7 am. If 7 am were a person, I would punch 7 am in the biscuits." - Paul Ryan, DailyRamblings
-
Jan 13th, 2006, 03:50 AM
#4
Re: [RESOLVED] RobDogs Spellcheck with array ?
I think a pipe character will not trigger any issues. I did a quick test and it didnt pick it up. So try concatinating all to be spelled textboxes, pass it to the SpellMe function, then parse by Split function to an array and replace each textboxes contents.
Pipe char: "|"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 13th, 2006, 04:11 AM
#5
Re: [RESOLVED] RobDogs Spellcheck with array ?
I don't get what the problem is. Why can't you just do what you said youself?
VB Code:
Public Sub CorrectSpelling(ByVal strings As String())
Dim Spell As PWBspell.clsSpellMe = New PWBspell.clsSpellMe
For Each str As String in Strings
str = Spell.SpellMe(str)
Next str
End sub
You can then place this method wherever you like. Alternatively you could inherit Rob's class and add another overload of the SpellMe method that does the same thing, calling the existing overload internally.
-
Jan 13th, 2006, 04:14 AM
#6
Re: [RESOLVED] RobDogs Spellcheck with array ?
Just instead of making several calls to the spell checking dialog, it would/may be best to have it spell check all ranges at once.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 13th, 2006, 04:21 AM
#7
Re: [RESOLVED] RobDogs Spellcheck with array ?
 Originally Posted by RobDog888
Just instead of making several calls to the spell checking dialog, it would/may be best to have it spell check all ranges at once.
I haven't used this spell checker so maybe I don't understand something. Would multiple calls open multiple dialogues, one for each string?
-
Jan 13th, 2006, 04:35 AM
#8
Re: [RESOLVED] RobDogs Spellcheck with array ?
One per call to SpellMe. So if its like he has in the first post you will be invoking the dialog twice but in series.
You mean you havent used my SpellChecker™
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 13th, 2006, 04:55 AM
#9
Re: [RESOLVED] RobDogs Spellcheck with array ?
-
Jan 16th, 2006, 06:58 AM
#10
Thread Starter
Fanatic Member
Re: [RESOLVED] RobDogs Spellcheck with array ?
RobDog,
The Pipe char works like a charm. You are a true gent and a star, I think I love you.
"I dislike 7 am. If 7 am were a person, I would punch 7 am in the biscuits." - Paul Ryan, DailyRamblings
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|