OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Using SpellChecker from VB6 or VB.Net

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets
View previous topic :: View next topic  
Author Message
hffm
Power User
Power User


Joined: 22 Jul 2005
Posts: 52
Location: GERARDMER FRANCE

PostPosted: Tue Dec 09, 2008 7:44 am    Post subject: Using SpellChecker from VB6 or VB.Net Reply with quote

Hello Here is an example of how to use spellchecker from VB6 or VB.net:
Code:
Public Sub TestSpellCheck()
    Dim GetProcessServiceManager As Object
    Dim SpellChecker As Object
    Dim ObjectReturn As Object
    Dim ObjectLocale As Object
    Dim I As Integer
    Dim EmptyArgs() 'Change to Dim EmptyArgs(-1) for VB.Net
    Dim AlternativesWord As Variant
    Set GetProcessServiceManager = CreateObject("com.sun.star.ServiceManager")
    Set ObjectLocale = GetProcessServiceManager.Bridge_GetStruct("com.sun.star.lang.Locale")
    Set SpellChecker = GetProcessServiceManager.CreateInstance("com.sun.star.linguistic2.SpellChecker")
    ObjectLocale.Language = "en"
    ObjectLocale.Country = "US"
    Set ObjectReturn = SpellChecker.SPELL("ist", ObjectLocale, EmptyArgs())
    If Not IsNull(ObjectReturn) Then
        AlternativesWord = ObjectReturn.GetAlternatives
        For I = 0 To ObjectReturn.getAlternativesCount - 1
            MsgBox AlternativesWord(I)
        Next I
    End If
End Sub
Back to top
View user's profile Send private message Visit poster's website
shahed2
Newbie
Newbie


Joined: 05 May 2009
Posts: 1

PostPosted: Tue May 05, 2009 4:54 am    Post subject: Reply with quote

Amazing code, very useful to me, thanks Smile
_________________
my openoffice
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group