Page 1 of 2 12 LastLast
Results 1 to 40 of 53

Thread: [RESOLVED] Dictionary Access

  1. #1

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Resolved [RESOLVED] Dictionary Access

    I have written a small VB 6 program using the Microsoft Word 11.0 object library. The program works fine when I declare "dim mwd as New Word.Application" and declare "Dim mwdsp as Word.SpellingSuggestions".

    But the dictionary that comes with Office 11.0 is rather old. I don't think I can attach a newer dictionary to MS Word 2003. Without moving on .NET, how can I access a newer dictionary, or a more comprehensive American English dictionary in VB6 without changing my code?

    Thanks

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: Dictionary Access

    I have not idea WHAT dictionary my Office 2013 uses..., but with this code in a module, I spell check my apps with it:

    (accessed like:
    Code:
    Clipboard.Clear
        Clipboard.SetText Text3.Text
        Text3.Text = SpellChk()
    )

    Code:
    Option Explicit
    
    Declare Function CoAllowSetForegroundWindow Lib "ole32.dll" (ByVal pUnk As Object, ByVal lpvReserved As Long) As Long
    
    Public Function SpellChk() As String
        Dim WordApp As Object
        Dim objDoc As Object 'Word.Document
        Dim lOrigTop As Long
        Dim lErr As Long
        On Error GoTo SpellChkErr
        ' Create a Word document object
        Set WordApp = CreateObject("Word.Application")
        CoAllowSetForegroundWindow WordApp, 0
        Set objDoc = WordApp.Documents.Add
        ' Position Word off screen to avoid having document visible
        lOrigTop = WordApp.Top
        WordApp.WindowState = 0
        WordApp.Top = -3000
        WordApp.Visible = True
        WordApp.Activate
        ' Assign the text to the document and check spelling
        With objDoc
            .Content.Paste
            .Activate
            .CheckSpelling
            ' After the user has made changes, use the clipboard to
            ' transfer the contents back to the text box
            .Content.Copy
            SpellChk = Clipboard.GetText(vbCFText)
            ' Close the document and exit Word
            .Saved = True
            .Close
        End With
        Set objDoc = Nothing
        WordApp.Visible = False
        WordApp.Top = lOrigTop
        WordApp.Quit
        Set WordApp = Nothing
        Exit Function
    SpellChkErr:
        lErr = Err
        SpellChk = Clipboard.GetText(vbCFText)
        Screen.MousePointer = vbNormal
        Select Case lErr
            Case 91, 429
                MsgBox "MS Word cannot be found!", vbExclamation
            Case Else
                MsgBox "Error: " & Err & " - " & Error$(Err), vbExclamation, App.ProductName
        End Select
    End Function

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Dictionary Access

    And for the OP, the difference is that you are loading a specific version of Word (early binding) whereas Sam is loading whatever version the user may have (late binding). In either case, Word is assumed to be present. There are differences with how you have to create the objects using Early vs. Late binding
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: Dictionary Access

    Why would my OS have a different Dictionary. I thought MS Office Pro supplies the dictionary?

    Thanks

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Dictionary Access

    Don't know if dictionary is different or not. Different versions of MS, possibly different versions of the dictionary (more current for newer Office versions). Does MS have a single dictionary it shares among all versions of office? Don't know.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: Dictionary Access

    Used supplied code from SamOscarBrown and got the same answer as with my code. The same dictionary was referenced by bot code.

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: Dictionary Access

    That is to be expected, as SamOscarBrown's code uses whatever version of Word is installed, so will be using the same version as your code does.

  8. #8
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Dictionary Access

    Well to try to answer this question, if I'm understanding you correctly
    Quote Originally Posted by AccessShell View Post
    But the dictionary that comes with Office 11.0 is rather old. I don't think I can attach a newer dictionary to MS Word 2003. Without moving on .NET, how can I access a newer dictionary, or a more comprehensive American English dictionary in VB6 without changing my code?
    You can only access whatever MS Office dictionary is on the user's system with the code you have. And I would think that if the user had a version less than Office 11, you would get an error; whereas Sam's code doesn't care which Office version exists as long as the Word application has the methods/properties he used in his sample code. The same office dictionary, I'd imagine, is used with all installed office products on that machine.

    To use another dictionary (online or on the system), you'll need to change your code to include calling whatever methods/properties that that specific dictionary exposes.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  9. #9

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: Dictionary Access

    I fully agree with you LaVolpe. I think, then, If I am able to get another dictionary on my computer, or via an online inquiry, I might be able to access that dictionary with some modified code. I don't think there are any VB6 references, components or objects that easily does this.

  10. #10
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Dictionary Access

    Well couple problems with on-line dictionaries:
    1) user's network availability & will the target site be available
    2) will the online site allow you to manipulate it remotely for this purpose?
    3) can it spell-check more than 1 word at a time?
    4) will it give you suggested corrections?

    Problems with other dictionaries (not Office)
    1) you'll need to transfer those with your program's setup files
    2) who updates these?
    3) when updated, now you need to redistribute the dictionary
    Example: There is a project on planetsourcecode. How often is that updated, if at all? See 2nd post in this thread

    And of course, what if no dictionary is available at all? If you're not distributing one, then you simply can't do spell checks, can you?
    Last edited by LaVolpe; May 15th, 2015 at 11:44 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  11. #11

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: Dictionary Access

    I looked at the code you suggested. Downloaded it and ran it. Sometimes it worked; sometimes it didn't. Besides, the code is way to advanced for me. I lost it in VB6 when classes were developed. I now only write without classes.

    Thanks for your help. I think I will consider this thread closed.

  12. #12

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    I did some some digging into this. When I ran the program on WIN 10, I got this error

    "Err.Source = C:\WINDOWS\Help\VBENLR98.CHM"
    "Err.Description = Automation error Library not registered."
    "Err.HelpContext = 1000440"

    I don't know what a "CHM" file is. This file is not present anywhere on my WIN 10 computer. However, I looked at my WIN 7, VMXP, computer and did NOT find this file either. Yet, the program works on VMXP.

    I believe the program was originally written in January of 2003. I don't know what version of VB existed then.
    Could that have anything to do with the problem?
    I looked on the VMXP computer and could not find the CHM file. I was going to copy it onto the WIN 10 computer.

  13. #13

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    This is the code
    Code:
    Private Sub cmdCheck_Click()Dim wd        As New Word.Application
    Dim wdsp      As Word.SpellingSuggestions
    Dim i         As Integer
    Dim strBuffer As String
    Dim varBuffer As Variant
    Dim synList   As Variant
    Dim antList   As Variant
    Dim synFound  As Boolean
    
    
        On Error GoTo cmdCheckErr
        
        lblSugs.Caption = NUM_OF_SUGS & CStr(0)
        lblSyns.Caption = NUM_OF_SYNS & CStr(0)
        lblAnts.Caption = NUM_OF_ANTS & CStr(0)
        lblMsg.Caption = ""
        lstSuggestions.Clear
        lstSynonyms.Clear
        lstAntonyms.Clear
        
        strBuffer = txtMain.Text
        
        cmdCheck.Enabled = False
        cmdQuit.Enabled = False
        
        frmMain.MousePointer = vbHourglass
        wd.Documents.Add        '***DIES HERE***********************************
       
        If Not wd.CheckSpelling(strBuffer) Then
            txtMain.ForeColor = vbRed
            lblMsg.Caption = "Spelling Incorrect!"
            lblMsg.ForeColor = vbRed
            Set wdsp = wd.GetSpellingSuggestions(strBuffer)
            lblSugs.Caption = NUM_OF_SUGS & CStr(wdsp.Count)
            
            For i = 1 To wdsp.Count
                lstSuggestions.AddItem wdsp(i).Name
            Next i
        Else
            varBuffer = CVar(strBuffer)
            lblMsg.Caption = "Spelling OK"
            lblMsg.ForeColor = vbBlue
            varBuffer = CVar(strBuffer)
            
            'Get the Synonyms
            synFound = SynonymInfo(Word:=varBuffer, LanguageID:=wdEnglishUS).Found
            If synFound = True Then
                synList = SynonymInfo(Word:=varBuffer, LanguageID:=wdEnglishUS).SynonymList(Meaning:=1)
                For i = 1 To UBound(synList)
                    lstSynonyms.AddItem synList(i)
                Next i
                lblSyns.Caption = NUM_OF_SYNS & CStr(UBound(synList))
            End If
            
            'Get the Antonyms
            'antList = SynonymInfo(Word:=varBuffer, LanguageID:=wdEnglishUS).AntonymList
            antList = SynonymInfo(varBuffer, wdEnglishUS).AntonymList
            For i = 1 To UBound(antList)
                lstAntonyms.AddItem antList(i)
            Next i
            lblAnts.Caption = NUM_OF_ANTS & CStr(UBound(antList))
        End If
        
        wd.Documents.Close
        wd.Quit
        Set wd = Nothing
        txtMain.ForeColor = vbBlack
        frmMain.MousePointer = vbDefault
        cmdCheck.Enabled = True
        cmdQuit.Enabled = True
        Exit Sub
        
    cmdCheckErr:
        MsgBox Err.Description & ", " & Err.Number
        Debug.Print "Err.Description = " & Err.Description & _
                    "Err.HelpContext = " & Err.HelpContext & _
                    "Err.HelpFile    = " & Err.HelpFile
        wd.Quit
        
    End Sub

  14. #14
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: [RESOLVED] Dictionary Access

    VBENLR98.chm is a compiled HTML file, a help file for the Microsoft scripting runtime.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  15. #15
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: [RESOLVED] Dictionary Access

    I added spellchecking in my "build-in" game-editor so the writer has a bit of help when writing the dialogs/text.
    a few things I needed to do was to create a "error-handler", this because sometimes word would close, if so, the program would re-initialize.
    so, 1 year passed and another person wanted to help with a side-story, but he got a crash. and investigating it showed word was the culprit.
    he told me has word, but not the spell-checking.
    after that I removed it all and created my own spell-checking function. and Im quite happy with that. now theres no problem whoever use it,
    since its not dependent of word and what OS and version or addon the person has.

  16. #16

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    That doesn't explain why, in my case, the version of Word is the same (2003).

    Nor why the CHM file does not appear in either OS. Yes, I still have my WIN 7 with the VMXP. The only difference, I am aware of, is the WIN 7 (witt the VMXP) is NOT connected to the internet.
    Last edited by AccessShell; Jan 10th, 2023 at 03:35 PM.

  17. #17
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: [RESOLVED] Dictionary Access

    the problem is NOT the CHM but:
    Automation error Library not registered

    it means word is not working properly.

  18. #18
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: [RESOLVED] Dictionary Access

    Quote Originally Posted by AccessShell View Post
    That doesn't explain why, in my case, the version of Word is the same (2003).
    Why would it be different? If you've got Word 2003 installed, that's what going to be used. If you were to upgrade it to a newer version and use Sam's code... then you should see it using a different version.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  19. #19

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    Does this mean that all I need do is reinstall MS Office 2003 Pro? I don't have MS Office 365 installed. Is that a deal breaker? Is MS trying to tell me use 365?

  20. #20
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: [RESOLVED] Dictionary Access

    each word is different and can have a different structure.
    also, it can be its not initialized correctly, or its not registered correctly to the register so VB can fetch it.
    or the register has a wrong ID, so there no match.

    but the problem is word.
    wd.Documents.Add

    Documents.Add < is not a valid command.
    could be u need to do
    wd.-something-.Documents.Add or something else.

    thats the problem here. u need to know the right command.

    when I used word, we had different versions. but it worked because all word versions did have the same command.
    I have not used Documents.Add

  21. #21

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access


  22. #22
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: [RESOLVED] Dictionary Access

    could be that as well.
    but I know that not all commands are the same.
    try to remove Documents.Add and see what happens.
    I only used word by word. so I never did grammar.
    worked for me. but word need to have spell-dictionary installed.

    or create your own spell-check, is not that hard to do.

  23. #23

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    I don't know why I didn't try this before, I ran the original code on the Win7 computer. It runs correctly. It lists the word and it's synonyms and antonyms correctly if it is a word. Otherwise, It gives suggestions for correct words.

  24. #24

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    Even though the program crashes, I successfully compiled it. Of course, it crashed on my computer. (Win Ver 22H2, but last week it was 21H2 and it still crashed).

    I copied the exe onto my friends Win10 laptop (21H2) with Office 2003 Pro. That computer does not have VB6 installed. The program worked correctly.

    I am now even more confused.

  25. #25
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: [RESOLVED] Dictionary Access

    I told u, its Documents.Add that is not working.
    the word version in your computer don't have that command so it crash.

  26. #26

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    I just said that my friend's computer has the same version of Word - Office Pro 2003

  27. #27
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: [RESOLVED] Dictionary Access

    something is different.
    did u try to remove Documents.Add and only use the CheckSpelling function and see if it works.
    if not, it means theres something wrong with the registry.

  28. #28

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    Yes. No change. Do you think I should re-install Office?

  29. #29

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    Oh, I wonder. I also have LibreOffice installed on my computer. Maybe there is an interaction?????

  30. #30
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: [RESOLVED] Dictionary Access

    create a new project and add this

    Code:
    Dim wd As Object
    Dim enable As Boolean
    
    Function CheckWord(ByVal Word$) As Boolean
        If enable Then
            On Error GoTo isError
            CheckWord = wd.CheckSpelling(Word$)
        End If
        Exit Function
    isError:
        InitializeWord
    End Function
    
    Sub InitializeWord()
        On Error Resume Next
        Set wd = Nothing
        Set wd = CreateObject("Word.Application")
        If Err.Number = 0 Then
            enable = True
            wd.Options.IgnoreMixedDigits = False
            wd.Options.IgnoreUppercase = False
        End If
    End Sub
    
    Sub DestroyWord()
        If enable Then
            On Error Resume Next
            wd.quit
            Set wd = Nothing
            enable = False
        End If
    End Sub
    
    Private Sub Form_Load()
        InitializeWord
        Debug.Print CheckWord("testing")
        Debug.Print CheckWord("wordnotfound")
        DestroyWord
    End Sub
    and see if it works or not.
    this is what I used in my program before I changed to my own spellcheck function.

  31. #31

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    Baka, your code works. I will rewrite my program.

    I have searched the internet for "Automation error Library not registered". I discovered that the code
    Code:
    wd.Documents.Add
    is not really the problem. All article I found suggest that I may have remnants of another version of "Office" on my computer. The only real solution is to go into the registry and delete the others. I don't remember any other office on this computer. I do remember being nagged my MS for Office 365. I finally removed the nag. I don't remember how.
    I am not eager to go into the registry.

  32. #32
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: [RESOLVED] Dictionary Access

    in my code add:

    Code:
    Private Sub Form_Load()
        InitializeWord
        wd.Documents.Add
        Debug.Print CheckWord("testing")
        Debug.Print CheckWord("wordnotfound")
        DestroyWord
    End Sub
    and see what happens. will wd.Documents.Add cause the same "Automation error Library not registered"?

    because u are using

    Dim wd As New Word.Application

    and that could be the problem.

    its the same with "flash" it works only if I make it dynamically using: Set Flash = Controls.Add("ShockwaveFlash.ShockwaveFlash", "Flash")
    if I add it to the components, it will cause issues in IDE. so maybe u need to create word from CreateObject

    if u check SamOscarBrown example, he also use CreateObject
    Last edited by baka; Jan 12th, 2023 at 09:49 AM.

  33. #33

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    Baka, in your new code, it does NOT give any errors. Thanks

    I will try to modify my original code!

  34. #34

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    Baka, I have integrated your code into my program. When the word is INcorrect, the program works correctly. It even gives a list of suggestions.

    If you refer to post #13 above, and look at what happens when the word is correct. The program correctly identifies the word as correct. However, when it tries to get a list of synonyms and antonyms, it crashes again with the same error as before
    "Automation error Library not registered".

  35. #35

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    This is the new code
    Code:
        If Not wd.CheckSpelling(strBuffer) Then        txtMain.ForeColor = vbRed
            lblMsg.Caption = "Spelling Incorrect!"
            lblMsg.ForeColor = vbRed
            Set wdsp = wd.GetSpellingSuggestions(strBuffer)
            lblSugs.Caption = NUM_OF_SUGS & CStr(wdsp.Count)
            
            For i = 1 To wdsp.Count
                lstSuggestions.AddItem wdsp(i).Name
            Next i
            '**********************************************************************
            'NOTE:  Incorrect spelling works great ==>  gives a list of suggestions
            '**********************************************************************
        Else
            lblMsg.Caption = "Spelling OK"
            lblMsg.ForeColor = vbBlue
            varBuffer = CVar(strBuffer)
            
            'Get the Synonyms
            Set wdsp = wd.GetSpellingSuggestions(strBuffer)
            synFound = SynonymInfo(Word:=varBuffer, LanguageID:=wdEnglishUS).Found
            'NOTE:  Now it dies on the previous line
            If synFound = True Then
                synList = SynonymInfo(Word:=varBuffer, LanguageID:=wdEnglishUS).SynonymList(Meaning:=1)
                For i = 1 To UBound(synList)
                    lstSynonyms.AddItem synList(i)
                Next i
                lblSyns.Caption = NUM_OF_SYNS & CStr(UBound(synList))
            End If
            
            'Get the Antonyms
            'antList = SynonymInfo(Word:=varBuffer, LanguageID:=wdEnglishUS).AntonymList
            antList = SynonymInfo(varBuffer, wdEnglishUS).AntonymList
            For i = 1 To UBound(antList)
                lstAntonyms.AddItem antList(i)
            Next i
            lblAnts.Caption = NUM_OF_ANTS & CStr(UBound(antList))
        End If
        
        txtMain.ForeColor = vbBlack
        frmMain.MousePointer = vbDefault
        cmdCheck.Enabled = True
        cmdQuit.Enabled = True

  36. #36
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: [RESOLVED] Dictionary Access

    Not sure what is going on....but here is what I am now using for Spell checking...I have MS Word 2007 (has always been my favorite even though I used 2013 for a while, and will NEVER use 365!). I have no issues with it finding that words are correct when they are not. (or vice-versa)..give this a try and see...

    Sam

    SPELLCHECK_Example.zip
    Sam I am (as well as Confused at times).

  37. #37

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    SamOscarBrown, I cannot open your code in VB6. I keep getting "Path not found" C:\My VB6

  38. #38
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: [RESOLVED] Dictionary Access

    ? Not sure ? I have no hardcoded paths
    Sam I am (as well as Confused at times).

  39. #39

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Dictionary Access

    SamOscarBrown Is this code you sent me
    Code:
    Private Sub Form_Load()strSearch = "Select * from myTitle"
    Adodc1.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " & App.Path & "\churchcalendars.accdb;Persist Security Info=False;"
    'adodc1.Recordset.DataSource
    Adodc1.RecordSource = strSearch
    'MsgBox Adodc1.Recordset.RecordCount
    Adodc1.Refresh
    
    
    End Sub

  40. #40
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: [RESOLVED] Dictionary Access

    No...at least not in this thread...

    Here it is again (without a Form1.Log file).

    Sammi

    SPELLCHECK_Example_13Jan23.zip
    Sam I am (as well as Confused at times).

Page 1 of 2 12 LastLast

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