I would like to query the display name of an OLE application, which is embedded in my Delphi XE4 Win32 app.
TOleContainer
class is used and the container can contain different OLE applications (e.g. MS Word, MS Excel, ...), dependent on what file is edited within.
What I want to be returned is Microsoft Word 2007 (or 2010 or 2013 or ...) or at least Microsoft Word, as it is displayed in the title bar of a normal Word instance.
EDIT: TOndrej's answer was very helpful. Thank you.
Unfortunally, as described in my comment underneath his answer, it does not show the real application caption. I found this question on SO. It's said there, that I could access the host application's caption with _Application.Caption
property. I don't have an instance of _Application
but IOleObject
. Typecast (MyOleObjectInterface as _Application
) failed.
How can the OleObject be accessed as _Application
?
_Application
? It's not an interface type that I recognise. – David HeffernanExcel2010
andWord2010
in Delphi XE4, for example. – René Hoffmann