views:

23

answers:

1

I think the title is fully descriptive now. Anyway, I need to generate a word document from my delphi application. It needs to choose from one of four different equations (with some specific parameters for each document). So far I have manage to create the whole document programmatically except the equation.

Is it possible to create equations programmatically? if so, where is de API documentation from MS? if not, which solution can be used?

A: 

Record a macro in a blank document of yourself adding an equation and then save the macro. Opening the macro up in the VBA editor will give you the exact VBA code required to programatically add an equation. If you're using Word's COM API, most of the methods in VBA should have COM counterparts. This technique can be used to discover how to programmatically do anything in Word that you can do in the GUI.

BrianCumminger
The problem with this method is that it records the action of adding an ole object (Selection.InlineShapes.AddOLEObject ClassType:="Equation.3", FileName:="", LinkToFile:=False, DisplayAsIcon:=False) but does not records anything of what I type inside the equation object.
Sambatyon