Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

Sign in to follow this  
Gooden

Corrector Através Open Office

Recommended Posts

Gooden

Estou a tentar fazer um corrector através do open office.

O problema é que ele não está a aceitar a linguagem pt.... Se meter  es,ES ou fr , FR ou en,US funciona. mas em pt PT nao funciona :|

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 = "pt_PT"
    ObjectLocale.Country = "PT"
    'ObjectLocale.Language = "en"
    'ObjectLocale.Country = "US"
    Set ObjectReturn = SpellChecker.SPELL("alando", ObjectLocale, EmptyArgs())
    If Not IsNull(ObjectReturn) Then
        AlternativesWord = ObjectReturn.GetAlternatives
        For I = 0 To ObjectReturn.getAlternativesCount - 1
            MsgBox AlternativesWord(I)
        Next I
    End If

Share this post


Link to post
Share on other sites
Gooden

Muda a linha ObjectLocale.Language = "pt_PT" para ObjectLocale.Language = "pt".

mesmo assim não funciona esquesito :|

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.