Correção Ortográfica no Word

Discussão em 'Interfaces' iniciado por fdantas, Fevereiro 19, 2009.

  1. fdantas

    fdantas Administrator Moderador

    Código:
    define input parameter h_Editor as widget-handle no-undo.
    define variable h_Word       as component-handle no-undo.
    define variable h_Doc        as component-handle no-undo.
    define variable l_NovoWord   as logical          no-undo.
    define variable l_AntVisible as logical          no-undo.
    
    create 'Word.Application' h_Word connect no-error.
    
    if  error-status:error then do:
        l_NovoWord = true.
        create 'Word.Application' h_Word no-error.
        if  error-status:error then do:
            run utp/ut-msgs.p (input "show", input 7663, input "").
            return 'adm-error'.
        end.   
    end.
    else do:
        l_AntVisible = h_Word:Visible.
        h_Word:Visible = false.
    end.
    
    assign h_Word:WindowState = 2.
    h_Doc = h_Word:Documents:Add().
    h_Doc:Characters:Item(1):InsertAfter(h_Editor:screen-value).
    h_Doc:CheckSpelling().
    h_Editor:screen-value = h_Doc:Range(0, h_Doc:Characters:Count):Text.
    h_Doc:Close(false).
    
    if  l_NovoWord then
        h_Word:Quit().
    else
        h_Word:Visible = l_AntVisible.
    
    release object h_Doc.
    release object h_Word.
    

Compartilhe esta Página