Author Topic: Long Text Spell Check Using Word  (Read 5313 times)

umang@guixt.com

  • Administrator
  • Newbie
  • *****
  • Posts: 34
    • View Profile
Long Text Spell Check Using Word
« on: January 27, 2016, 10:01:12 AM »
Integrating Word Spell Checker, for verifying the text entered within a long text control in SAPGUI using Liquid UI

Liquid UI Script

// 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('?');

}

See Attachments for Samples