Liquid UI - WS Reference Library

Word spell checker


Purpose

Integrating Word Spell Checker, for verifying the text entered within a long text control in SAPGUI using Liquid UI.


User Interface


Click on ‘MS Word Spell Check’, Word spell checker opens up.


Click on ‘Change’ or ‘Change All’ or ‘AutoCorrect’ to apply the Spell Checker.


Once Complete, the text is updated on SAPGUI screen.


Liquid UI Script

//ESESSION.sjs

// wsoffice.dll is required to be installed
load('wsoffice');

//zguixt.e0100.sjs

// Sample User Interface
box([1,0], [12,72], "Spelling Check - MS Word Automation");
textbox([2,1],[11,71],{'name':'sampletext'});
pushbutton([13,0],'@3V@MS Word Spell Check',{'process':spellCheck});

// Sample Function
function spellCheck() {
    var myWord = new ActiveXObject('Word.Application');

    myWord.Caption = "Spell Check";
    myWord.Visible = true;

    var doc = myWord.Documents.Add();
    doc.Activate();
    doc.Content.Text = sampletext;
    doc.CheckSpelling();

    newText = doc.Content.Text;
    doc.Saved = false;
    doc.Close(0);
    doc = null;

    myWord.Quit();
    myWord = null;

    onscreen '*'
        copytext({'fromstring':'newText', 'totext':'sampletext'});
        enter('?');

}

Was this information helpful? Send Feedback