2009. augusztus 20., csütörtök

How to run an application in a TOLEContainer without using the Insert Object dialog


Problem/Question/Abstract:

I want to run MS Word by using TOleContainer but I don't want to use the Insert Object dialog. How can I do that?

Answer:

{Creating a new Word document in an Olecontainer}
OleContainer1.CreateObject('Word.Document', False);
OleContainer1.DoVerb(ovShow);

{Loading an existing document in an Olecontainer}
OleContainer1.CreateObjectFromFile('C:\Docs\Doc1.doc', False);
OleContainer1.DoVerb(ovShow);

Nincsenek megjegyzések:

Megjegyzés küldése