J’essaie de récupérer les informations du correcteur orthographique, mais un simple test sur la validité d’un mot ne passe pas, et me renvoie invariablement l’erreur: Valeur de propriété incorrecte.
Code : Tout sélectionner
Sub Spell
Dim locale As New com.sun.star.lang.Locale
Dim word As String
Dim bWordValid As Boolean
locale.Language="fr" 'ISO 639
locale.Country="FR" 'ISO 3166
LinguService = createUnoService("com.sun.star.linguistic2.LinguServiceManager")
spellChecker = LinguService.getSpellchecker()
if not spellChecker.hasLocale(locale) Then
msgbox "Le dictionnaire français est introuvable"
exit sub
endif
'XRay spellChecker
word = inputbox("Mot à vérifier:")
while word <> ""
bWordValid = spellChecker.isValid(word, locale, array())
if bWordValid then
msgbox word + " est valide"
else
msgbox word + " n’est pas valide"
endif
word = inputbox("Mot à vérifier:")
wend
End Sub
Cf. API: http://api.openoffice.org/docs/common/r ... ecker.html
Une idée de l’origine du problème?
Merci d’avance.
Fichier de test: