Results 1 to 6 of 6

Thread: Advanced Text Editor

  1. #1

    Thread Starter
    Banned ScriptKing1's Avatar
    Join Date
    May 2007
    Location
    idk
    Posts
    4

    Question Advanced Text Editor

    Hey,

    I'm scriptking1 and recently I've started a project, and it is an advanced text editor. This text editor won first in the TSA(Technology Student Association)2007 State Level Conference. I would be going to the national level, but apparently they don't have that competition available to middle school students. Anyway, I continued working on the project, adding better features like Spell Check, and Find... I also fixed bugs like an unchecked word wrap which led you to believe that it was off. I ran into a dillemma though, all the posts for the spell check feature aren't what I initially wanted. I wanted spell check to be like Word where as soon as you made the error, it underlined it (_______) kinda like that, and gave you options as how to fix it. Can anyone please help me with this. Also, being wrapped up in the spell check dillemma, won't let me concetrate, and I can't think of any extra-features to add-in. If you download my installer of Programmer's Editor v.1.1.0.3 down below, you can see what I have so far in this developing project. Thanks in advance for anyone who can help me, or anyone who tries.
    P.S I had to learn VB.NET in a couple of days for the TSA Competition, so please explain how to do any of your sugestions, for I guess you can say I'm a Noob.
    Note: I promise to add Images and stuff later as soon as I set them up.
    I got this code from RobDog888, and I changed it around to fix the errors showing on my pc.
    The Spell Check Code I'm Currently Using.

    vb Code:
    1. Option Explicit On
    2. Option Strict On
    3. 'Copyright © 2005 by RobDog888 (VB/Office Guru™). All Rights reserved.''Distribution: You can freely use this code in your own'              applications provided that this copyright'              is left unchanged, but you may not reproduce'              or publish this code on any web site, online'              service, or distribute as source on any'              media without express permission.
    4. Imports Microsoft.Office.Interop
    5. Public Class SpellCheck
    6.     Friend moApp As Word.Application
    7.     Private mbKillMe As Boolean
    8.     Friend Property KillMe() As Boolean
    9.         Get
    10.             InitializeMe()
    11.             KillMe = mbKillMe
    12.         End Get
    13.         Set(ByVal Value As Boolean)
    14.             mbKillMe = Value
    15.         End Set
    16.     End Property
    17.     Friend Sub InitializeMe()
    18.         Try
    19.             '<INITIALIZE WORD>            
    20.             moApp = DirectCast(GetObject(, "Word.Application"), Word.Application)
    21.         Catch ex As Exception
    22.             If TypeName(moApp) = "Nothing" Then
    23.                 moApp = DirectCast(CreateObject("Word.Application"), Word.Application)
    24.                 mbKillMe = True
    25.             Else
    26.                 MessageBox.Show(ex.Message, "VB/Office Guru™ SpellChecker™.NET", _
    27.                 MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
    28.             End If
    29.         End Try
    30.     End Sub
    31.     Friend Function SpellMe(ByVal msSpell As String) As String
    32.         Dim oDoc As Word.Document
    33.         Dim iWSE As Integer
    34.         Dim iWGE As Integer
    35.         Dim iResp As Integer
    36.         Dim sReplace As String
    37.         If msSpell = String.Empty Then Exit Function
    38.         Try
    39.             InitializeMe()
    40.             Select Case moApp.Version
    41.                 Case "9.0", "10.0", "11.0"
    42.                     oDoc = moApp.Documents.Add(, , 1, True)
    43.                 Case "8.0"
    44.                     oDoc = moApp.Documents.Add
    45.                 Case Else
    46.                     MessageBox.Show("Unsupported Version of Word.", "VB/Office Guru™ SpellChecker™.NET", _
    47.                     MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
    48.                     Exit Function
    49.             End Select
    50.             oDoc.Words.First.InsertBefore(msSpell)
    51.             iWSE = oDoc.SpellingErrors.Count
    52.             iWGE = oDoc.GrammaticalErrors.Count
    53.             '<CHECK SPELLING AND GRAMMER DIALOG BOX>            
    54.             If iWSE > 0 Or iWGE > 0 Then
    55.                 '<HIDE MAIN WORD WINDOW>                
    56.                 moApp.Visible = False
    57.                 If (moApp.WindowState = Word.WdWindowState.wdWindowStateNormal) Or _
    58.                 (moApp.WindowState = Word.WdWindowState.wdWindowStateMaximize) Then
    59.                     moApp.WindowState = Word.WdWindowState.wdWindowStateMinimize
    60.                 Else
    61.                     moApp.WindowState = Word.WdWindowState.wdWindowStateMinimize
    62.                 End If
    63.                 '</HIDE MAIN WORD WINDOW>                
    64.                 '<PREP CHECK SPELLING OPTIONS DIALOG BOX (MODIFY TO YOUR PREFERENCES)>                
    65.                 moApp.Dialogs(Word.WdWordDialog.wdDialogToolsSpellingAndGrammar).Application.Options.CheckGrammarWithSpelling = True
    66.                 moApp.Dialogs(Word.WdWordDialog.wdDialogToolsSpellingAndGrammar).Application.Options.SuggestSpellingCorrections = True
    67.                 moApp.Dialogs(Word.WdWordDialog.wdDialogToolsSpellingAndGrammar).Application.Options.IgnoreUppercase = True
    68.                 moApp.Dialogs(Word.WdWordDialog.wdDialogToolsSpellingAndGrammar).Application.Options.IgnoreInternetAndFileAddresses = True
    69.                 moApp.Dialogs(Word.WdWordDialog.wdDialogToolsSpellingAndGrammar).Application.Options.IgnoreMixedDigits = False
    70.                 moApp.Dialogs(Word.WdWordDialog.wdDialogToolsSpellingAndGrammar).Application.Options.ShowReadabilityStatistics = False
    71.                 '</PREP CHECK SPELLING OPTIONS DIALOG BOX (MODIFY TO YOUR PREFERENCES)>                
    72.                 '<DO ACTUAL SPELL CHECKING>                
    73.                 moApp.Visible = True
    74.                 moApp.Activate()
    75.                 iResp = moApp.Dialogs(Word.WdWordDialog.wdDialogToolsSpellingAndGrammar).Display
    76.                 '</DO ACTUAL SPELL CHECKING>                
    77.                 If iResp < 0 Then
    78.                     moApp.Visible = True
    79.                     MessageBox.Show("Corrections Being Updated!", "VB/Office Guru™ SpellChecker™", _
    80.                     MessageBoxButtons.OK, MessageBoxIcon.Information)
    81.                     oDoc.Select()
    82.                     oDoc.Range.Copy()
    83.                     sReplace = DirectCast(Clipboard.GetDataObject.GetData("System.String", True), String)
    84.                     '<FIX FOR POSSIBLE EXTRA LINE BREAK AT END OF TEXT>                    
    85.                     If (InStrRev(sReplace, Chr(13) & Chr(10))) = (Len(sReplace) - 1) Then
    86.                         sReplace = Mid$(sReplace, 1, Len(sReplace) - 2)
    87.                     End If
    88.                     '</FIX FOR POSSIBLE EXTRA LINE BREAK AT END OF TEXT>                    
    89.                     SpellMe = sReplace
    90.                 ElseIf iResp = 0 Then
    91.                     MessageBox.Show("Spelling Corrections Have Been Canceled!", "VB/Office Guru™ SpellChecker™.NET", _
    92.                     MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
    93.                     SpellMe = msSpell
    94.                 End If
    95.             Else
    96.                 MessageBox.Show("No Spelling Errors Found" & Environment.NewLine & "Or No Suggestions Available!", _
    97.                 "VB/Office Guru™ SpellChecker™.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
    98.                 SpellMe = msSpell
    99.             End If
    100.             '</CHECK SPELLING AND GRAMMER DIALOG BOX>            
    101.             oDoc.Close(False)
    102.             oDoc = Nothing
    103.             '<HIDE WORD IF THERE ARE NO OTHER INSTANCES>            
    104.             If KillMe = True Then
    105.                 moApp.Visible = False
    106.             End If
    107.             '</HIDE WORD IF THERE ARE NO OTHER INSTANCES>        
    108.         Catch ex As Exception
    109.             MessageBox.Show(ex.Message, "Welcome To Programmer's Editor Spell Check", _
    110.             MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
    111.         End Try
    112.     End Function
    113. End Class
    If RobDog888 Reads This: The Exit Function on line 37 is giving me a warning.
    Download this .zip file to get the installer, and source code.
    Last edited by ScriptKing1; May 3rd, 2007 at 06:47 PM. Reason: I'm leaving

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Advanced Text Editor

    Moved from the CodeBank

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

    Re: Advanced Text Editor

    Why did you remove my Copyright disclaimer from my code comments? That is a copyright infringement.

    I dont believe the TSA would appreciate you using someone elses code in your code seing how its a competition for scholarships and awards etc. So please do not enter your app in any future contests without the proper acknowledgements in the code and in your app somewhere visible.

    Thank you.
    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

  4. #4

    Thread Starter
    Banned ScriptKing1's Avatar
    Join Date
    May 2007
    Location
    idk
    Posts
    4

    Unhappy Re: Advanced Text Editor

    Sorry, i haven't even published it yet. I referenced it in the post as your code though, and i left your VB/Office Guru™ SpellChecker™.NET.
    I wasn't even posting this as my own tutorial. I just posted it for you to see, and help me.
    P.S TSA isn't for scholarships and etc. and the competition already passed.
    I didn't have spell check in that version, i used my own code.
    I'll put back you Copyright disclaimer, even though vb doesn't compile notes.

  5. #5
    Addicted Member
    Join Date
    Dec 2005
    Posts
    139

    Re: Advanced Text Editor

    Quote Originally Posted by ScriptKing1
    I'll put back you Copyright disclaimer, even though vb doesn't compile notes.
    True, VB doesn't compile comments, but in a situation where I might use someone elses code and they requested acknowledgement, then I would give them acknowledgement in the help file and/or about dialog.

    CT

  6. #6

    Thread Starter
    Banned ScriptKing1's Avatar
    Join Date
    May 2007
    Location
    idk
    Posts
    4

    Arrow Re: Advanced Text Editor

    Thanks, but i know that. It is just that he thinks i'm going to infringe his work even though i referenced him on this page, i told him i was adding this spell check for fun, not for competition, because competition is over(about 3 weeks ago.). Also i told him that i made that page for him to look at. I'm being dead honest, and now he's so pissed off, he won't help me with my problem. So if you know him, please let him know i am being sincere.

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