Creating an Equation Editor 3.0 equation in a Word 2003 document using a marco (or through the API)

核能气质少年 提交于 2019-12-08 08:13:04

问题


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?


回答1:


Going the VBA route that Brian suggested will only give you the code to open Equation Editor; it won't give you the code for actually creating the equation.

Perhaps the MathType SDK will be of use to you. It's a free download.




回答2:


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.



来源:https://stackoverflow.com/questions/2729352/creating-an-equation-editor-3-0-equation-in-a-word-2003-document-using-a-marco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!