'Delphi: Call OLE mrethod whose name is stored in a string

I'm looking for a way to execute a method of an OLE object by passing a string, like for example:

Call_OLE_Method('word.application','application.documents.open(''C:\temp\MyDoc.docx'')');

This would be equivalent to

var FWordApp:=CreateOleObject('Word.Application');
FWordApp.application.documents.open('C:\temp\MyDoc.docx');

Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source