Results 1 to 11 of 11

Thread: Spelling?? **Resolved**Thanks Guys!

  1. #1

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134

    Angry Spelling?? **Resolved**Thanks Guys!

    Is there no support to check spelling in .net???
    Last edited by Rally2000; Dec 25th, 2003 at 05:31 AM.

  2. #2
    Lively Member
    Join Date
    Jul 2003
    Location
    Kuala Lumpur (Malaysia)
    Posts
    92

    Smile

    Hi,

    Yup. It might be available in the VS.Net 2004 codename "WhidBey"

    Merry Chrismas..

  3. #3
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    presently not.

    but it checks ur syntax .....
    Regards

  4. #4
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    What about block comments? There's a macro to comment out selected blocks, but not one to uncomment them (at least in VB7). In either VB6 or eVB there was a utility available to do this, same for Delphi. What about .Net? And can a macro be added to the toolbar?

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can comment and uncomment selected lines from the toolbar. I'll attach a picture. The one on the left comments and the one on the right uncomments there isn't even a need for a macro. If you don't see this toolbar then right click on the toolbars you do have and check 'Text Editor' to get it.


  6. #6
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Thanks Edneiss.

  7. #7

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    Why would Microsoft do this?
    They have a toolkit that will add support for office 2003, but 2003 only. Are they hurting for money that bad? I don't understand that type of logic, on one hand they add all kinds of new toys but on the other hand they are taking away some of the necessary stuff.
    Beats me!

  8. #8
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Do you mean Visual Studio 2003?

    Either way you can build your own addin to check spelling or even just a macro. Especially if you have one of Word because you can use its spellchecker via code. Of course if you don't have Word or want to build your own then there are 3rd party ones out there. I know there are 3rd part spell checking components and I'd imagine that if you google you might find an addin that someone has already made for your version of Visual Studio.

  9. #9

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    I have found an article that describes how to code this option but it did not work for me.It keeps on showing me that same old error. here is the Code.
    Code:
    Private Sub SpellOrGrammarCheck(ByVal blnSpellOnly As Boolean)
    
            Try
                Dim objWord As Object
                Dim objTempDoc As Object
                Dim iData As IDataObject
    
                If TextBox1.Text = "" Then
                    Exit Sub
                End If
                objWord = New WordApplication '<------Error is here Why?
                objTempDoc = objWord.Documents.Add
                objWord.Visible = False
                objWord.WindowState = 0
                objWord.Top = -3000
                Clipboard.SetDataObject(TextBox1.Text)
    
                With objTempDoc
                    .Content.Paste()
                    .Activate()
                    If blnSpellOnly Then
                        .CheckSpelling()
                    Else
                        .CheckGrammar()
                    End If
    
                    .Content.Copy()
                    iData = Clipboard.GetDataObject
                    If iData.GetDataPresent(DataFormats.Text) Then
                        TextBox1.Text = CType(iData.GetData(DataFormats.Text), _
                            String)
                    End If
                    .Saved = True
                    .Close()
                End With
    
                objWord.Quit()
    
                MessageBox.Show("The spelling check is complete.", _
                    "Spell Checker", MessageBoxButtons.OK, _
                    MessageBoxIcon.Information)
    
            Catch COMExcep As COMException
                MessageBox.Show( _
                    "Microsoft Word must be installed for Spell/Grammar Check " _
                    & "to run.", "Spell Checker")
    
            Catch Excep As Exception
                MessageBox.Show("An error has occured.", "Spell Checker")
    
            End Try
    
        End Sub
    PS: I have run some 3rd party spell engines and have to say that the ones I tried aren’t worth having. Don’t get this the wrong way, I’m not trying to knock someone else’s software, it is just that they where missing some of the simplest words to correct.
    Bottom line: What I wanted to do, was to build a notepad with the spell and grammar option in it, but I did not realize that it was such a dig deal in .Net


  10. #10
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You didn't mention what error it was that you are getting but you need to make a reference to the Word object Library in order to run that code, since you use early binding.

  11. #11

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    I did make a reference to it using: Microsoft NetShow Real-Time Encoder Callback Proxy Type Library. LOL
    Sorry about that, I did not even notice it till I was ready to delete the all references and start over, I should have checked it in the first place.
    Anyway! That code works just fine.
    Also if someone happens to do a search for the same thing, here is something else that can be used.
    Code:
    ‘Put this into the click event 
    If TextBox1.Text.Length > 0 Then
                Dim Word As New Word.ApplicationClass
                Dim doc As Word.DocumentClass = Word.Documents.Add()
                Word.Visible = False
    
                Clipboard.SetDataObject(TextBox1.Text)
                doc.Content.Paste()
                doc.Activate()
                doc.CheckSpelling()
                doc.Content.Copy()
                If Clipboard.GetDataObject.GetDataPresent(DataFormats.Text) Then
                    TextBox1.Text = CType(Clipboard.GetDataObject.GetData(DataFormats.Text), String)
                End If
                doc.Saved = True
                doc.Close()
                Word.Quit()
    
    
            End If
    Also works well.

    Thanks Edneeis for the heads up !


    Happy Holidays

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