• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

Using Word as an embedded editor

I want to create and edit Word documents from "inside" a Delphi app .. RichEdit/RTF will not suffice because I need to retain the style names .. the name that comes up in the drop down list box in Word.

OK, so I need Word as an "embedded editor". There is various automation stuff around re starting Word, but I would like to start it as if it was in a window that I controlled - I want it to start in a smallish window near where I click on a node in a treeview.

any clues?

Then to make it more interesting, I want to be notified if the user has saved or closed that document.  I would prefer to control how they save it and whether they can close it, but being notified would suffice.

  • 2
1 Solution

One option could be to use OleContainer (from System tab):

// ocMain is a TOleContainer
 ocMain.CreateObjectFromFile('c:\test.doc', False);

then you can use the OleObject, which holds the dispatch interface to call the SaveAs method.

For example:

 // Save document as "c:\test.doc"

Regards, Geo
Mutley2003Author Commented:
Geo, that works great,
thanks very much
You are welcome :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now