TranslatorFileName As String 'file name of the translator to use or "" to convert to MT equations PromptUser As Boolean 'True=prompt user whether to convert each equation SelectionOnly As Boolean 'True=process selection only, False=whole document ShowStats As Boolean 'show #equations formatted at end of processing documentĮquationTypes As Long 'types of equations to convert, one or more of the mt_CVT_FIND constants above Public Const mt_CVT_TRAN_MTEF As Long = 2 'include MathType data in translation Public Const mt_CVT_TRAN_NAME As Long = 1 'include translator name in translation Public Const mt_CVT_FIND_TRANSLATOR As Long = 4 'find translated (text) equations Public Const mt_CVT_FIND_WORDEQ As Long = 2 'find Word EQ fields Public Const mt_CVT_FIND_MTEE As Long = 1 'find MathType and EE equations 'Types and constants used for calling ConvertEquations Info ConvertEquationsInfo structure defined below If it is not in the list, use the Browse button to locate it in the templates folder inside the SDK folder. To do this, switch to the Visual Basic Editor via ALT-F11 on Windows and select Tools|References, then select MT6SDK.dot from the list. To avoid problems with macro security in Word 2000 and above on Windows, set your security level to Medium or Low, since these macros are unsigned.You must create a reference to MT6SDK.dot before running any of the test macros in these two templates. MTVarSub.dot shows the many variations possible for search-and-replace, a.k.a variable substitution. The first template,SDKTest.dot, contains examples of how to call Format, Convert, Export and Toggle Equations non-interactively, as well as a simple search-and-replace example. Two sample templates are provided: SDKTest.dot and MTVarSub.dot. See the MathType Commands For Word API for details. The file MT6SDK.dot (in the SDK's templates folder) contains some additional functions that may be useful if you want to suppress the dialogs that normally appear during Format, Convert, Export and Toggle Equations. It contains comments which should make it easier to understand. The SDK contains unlocked copies of these templates so that you can see the code. The best way to understand how a particular command works is to follow through the VBA code. The handler functions not only verify the correct versions of the WLLs and load the WordCmds.dot template, they also call some initialization routines that are necessary for the API functions to work. If you want to call your own function in the WordCmds.dot template, be sure to use the same kind of handler as the existing commands. The stub contains handlers for each toolbar button and menu command each of them loads the commands template if it isn't loaded yet, and then calls a function in the commands template that actually does the work. The commands template takes a few seconds to load users only pay this price the first time they use any MathType command. The stub template has been kept as small as possible so that a minimal delay will occur when Word starts. These two templates are used in this manner in order to avoid long Word startup times. The first time a MathType command is used in Word, the commands template is explicitly loaded from the Office Support folder inside the MathType folder. The stub template is also copied to the Microsoft Word Startup location during installation, and gets loaded when Word starts. There are two Word templates located in the Office Support folder inside the MathType folder: the stub, named MathType 6 Commands for Word.dot and the commands, named WordCmds.dot. The WLL also contains other functions used by the MathType Commands for Word these functions begin with the MT prefix. This is a fairly complicated process and you're unlikely to use any of the individual MathPage functions. The WLL contains the MathPage functions (prefixed by MP), which help in converting a Word document to HTML. This is partly due to the way VBA code calls functions in a DLL, and partly because a single entry-point makes for a cleaner architecture. For the MathType 6 Word Commands on Windows, all entry points to the DLL are accessed via the WLL. On Windows, it is installed in the Office Startup folder. The WLL (basically a DLL with some Word-specific entry points) is named MathPage.WLL. All API functions in MT6.DLL begin with the prefix MT. Most of the functions in the DLL provide support for the MathType commands added to Word. This DLL manages all communications with MathType itself, launching MathType when necessary. On Windows, the DLL is named MT6.DLL and is located in the System folder inside the MathType folder. The MathType API consists of a WLL, two Microsoft Word document templates containing VBA macros, and a separate DLL (on Windows only).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |