|
-
Dec 24th, 2003, 04:16 AM
#1
Thread Starter
Addicted Member
Spelling?? **Resolved**Thanks Guys!
Is there no support to check spelling in .net???
Last edited by Rally2000; Dec 25th, 2003 at 05:31 AM.
-
Dec 24th, 2003, 04:32 AM
#2
Lively Member
Hi,
Yup. It might be available in the VS.Net 2004 codename "WhidBey"
Merry Chrismas..
-
Dec 24th, 2003, 10:58 AM
#3
Hyperactive Member
presently not.
but it checks ur syntax .....
-
Dec 24th, 2003, 11:18 AM
#4
Frenzied Member
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?
-
Dec 24th, 2003, 11:30 AM
#5
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.
-
Dec 24th, 2003, 11:37 AM
#6
Frenzied Member
-
Dec 24th, 2003, 03:21 PM
#7
Thread Starter
Addicted Member
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!
-
Dec 24th, 2003, 03:30 PM
#8
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.
-
Dec 24th, 2003, 05:13 PM
#9
Thread Starter
Addicted Member
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
-
Dec 24th, 2003, 06:40 PM
#10
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.
-
Dec 24th, 2003, 08:25 PM
#11
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|