ole

ole

Automation (OLE)

see http://en.wikipedia.org/wiki/OLE_Automation

more examples http://forge.scilab.org/index.php/p/ole/source/tree/master/examples.sce

example: we call outlook

pOutlook = ole_actxserver("Outlook.Application");

pItem = ole_get(pOutlook, "CreateItem",0);

ole_set(pItem, "Subject","hello");

ole_set(pItem, "To","allan.cornet@scilab.org")

ole_set(pItem, "Body","test send email")

ole_invoke(pItem, "Display")

ole_invoke(pItem, "Send")

example: we call Word

pWord = ole_actxserver("Word.Application");

ole_set(pWord, "Visible", 1);

pDocs = ole_get(pWord, "Documents");

pDocOpened = ole_invoke( pDocs, "Add");

pSelection = ole_invoke(pWord, "Selection");

ole_set(pSelection,"Text","Hello text in Word");

pActiveDocument = ole_get(pWord, "ActiveDocument");

pSaveAs = ole_invoke(pActiveDocument, "SaveAs","d:/foo.doc");

ole_invoke(pWord, "Quit");

example: we call Internet Explorer

pIE = ole_actxserver("InternetExplorer.Application")

ole_invoke(pIE,"Navigate","http://www.scilab.org")

ole_set(pIE,"Visible",%t)

ole_invoke(pIE,"Quit")

ole_delete(pIE)

clear(pIE)

// example: we call VBScript

pScript = ole_actxserver('MSScriptControl.ScriptControl')

ole_set(pScript, 'Language', 'VBScript')

ole_invoke(pScript,'Eval','MsgBox(""Hello world"")')

ole_delete(pScript)

Development Team
Admins
Allan Cornet
Happy Crew
Antoine Elias

Powered by InDefero,
a Céondo Ltd initiative.