Results 1 to 10 of 10

Thread: [RESOLVED] RobDogs Spellcheck with array ?

  1. #1

    Thread Starter
    Fanatic Member staticbob's Avatar
    Join Date
    Jan 2005
    Location
    Manchestershire, UK Cabbage: I do
    Posts
    619

    Resolved [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:
    1. Public Sub Spell()
    2.         Try
    3.             'Get New instance of PWBSpell.dll
    4.             Dim Spell As PWBspell.clsSpellMe = New PWBspell.clsSpellMe
    5.  
    6.             'Perform SpellCheck
    7.             tb_NTCComments.Text = Spell.SpellMe(tb_NTCComments.Text)
    8.             tb_NTCSubject.Text = Spell.SpellMe(tb_NTCSubject.Text)
    9.         Catch ex As Exception
    10.             EH.Log(ex)
    11.         End Try
    12.     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

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3

    Thread Starter
    Fanatic Member staticbob's Avatar
    Join Date
    Jan 2005
    Location
    Manchestershire, UK Cabbage: I do
    Posts
    619

    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

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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:
    1. Public Sub CorrectSpelling(ByVal strings As String())
    2.     Dim Spell As PWBspell.clsSpellMe = New PWBspell.clsSpellMe
    3.  
    4.     For Each str As String in Strings
    5.         str = Spell.SpellMe(str)
    6.     Next str
    7. 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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] RobDogs Spellcheck with array ?

    Quote 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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] RobDogs Spellcheck with array ?

    Quote Originally Posted by RobDog888
    You mean you havent used my SpellChecker™
    Downt neeed tu yous it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10

    Thread Starter
    Fanatic Member staticbob's Avatar
    Join Date
    Jan 2005
    Location
    Manchestershire, UK Cabbage: I do
    Posts
    619

    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
  •  



Click Here to Expand Forum to Full Width