/* To make this code work, OpenOffice writer has to be initilized before running the program and the spellchecker has to be used a list once. I going to keep working with more examples and try put more code, to other developer please put code as well so we can achieve with OpenOffice the same as with MS Office */ OLEObject objServiceManager objServiceManager = CREATE OLEObject IF objServiceManager.ConnectToNewObject & ("com.sun.star.ServiceManager") < 0 Then messagebox("OLE Error", "Cound not connect to Open Office") End IF //// Create the Desktop OLEobject objDesktop objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop") OLEObject objCoreReflection objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection" ) OLEObject objPropertyClass objPropertyClass = objCoreReflection.forName ("com.sun.star.beans.PropertyValue") OLEObject objPropertyValue[] //!!!! CreateObject takes an OUT parameter. // refer to the UNO IDL interface descriptions, to find // the proper parameter types objPropertyClass.CreateObject(REF objPropertyValue[1]) //objPropertyValue.Name = "IsGermanPreReform" //objPropertyValue.Value = true OLEObject objLocalClass objLocalClass = objCoreReflection.forName( 'com.sun.star.lang.Locale') OleObject aLocale objLocalClass.CreateObject( REF aLocale ) aLocale.Language = "sv" aLocale.Country = "SE" aLocale.Variant = "" OLEObject objLSM objLSM = objServiceManager.CreateInstance & ("com.sun.star.linguistic2.LinguServiceManager") OleObject spellchecker spellchecker = objLSM.getSpellChecker() String aWord boolean bls_correct any la_any aWord = sle_word.text messagebox('aWord',aWord) la_any = spellchecker.isValid( aWord ,aLocale , objPropertyValue) messagebox('aWord',aWord) IF isNull(la_any) THEN messagebox("la_any"," Null") END IF messagebox("la_any",string(la_any)) objServiceManager.disconnectobject() destroy objServiceManager