TechNote #63:
| Last modified: 07/28/00
Last reviewed: 07/04/01
|
"Out of memory" Microsoft Visual Basic Error After Upgrading
Microsoft Word
The information in this document applies to:
|
MathType 3.5 (Mac)
|
Microsoft Word 98 (Mac)
Microsoft Word 2001 (Mac)
|
Issue
Many users who have MathType 3.5, after upgrading to Microsoft Word 98 or
later, find that they receive the following message, either when they launch
Microsoft Word or when they open a document created with a previous version of
Microsoft Word,

Reason
The MathType Commands for Word macro template was written for Microsoft Word
6.0 which used WordBasic as its macro language. With the release of Microsoft Word 98,
Microsoft switched to Visual Basic for Applications (VBA) as its macro language.
The WordBasic macros included with MathType 3.5 were
written for Word 6.0 cannot be used with Word 98.
Solution
If you are receiving this error message when you start Microsoft Word, rather
then when attempting to install MathType's macros, you will need to rename your
Microsoft Word Normal template.
If you want macros for a version of Microsoft Word later than Microsoft Word
6.0, the simplest solution is to upgrade to a newer version of MathType for the
Macintosh. It is possible to write a macro for inserting MathType equations and
to place a button for this macro on a toolbar in Microsoft Word. If you would
also like macros for inserting equation sections, numbers, and references, as
well as updating all the equations in a document, it will be necessary to
upgrade.
This notice addresses the following issues,
1. Renaming the Normal template for Microsoft Word
2. Creating a macro to insert a MathType equation
3. Placing a button on the toolbar
4. Making MathType the default
equation editor
Renaming the Normal template for Microsoft Word
One thing to note before renaming your Normal template is that it contains your macros,
styles, and menu and toolbar customizations. Renaming your Normal template will force
Microsoft Word to create a new Normal template which will reset Microsoft Word to its
default, which will not have the old MathType macros for WordBasic attached to
it. You should rename your current Normal file instead of deleting it if you have macros
or styles that you want to keep. You can copy any macros or styles that you have written from your current Normal
template to the new one. You will need to redo any toolbar customizations.
- Quit all running applications.
- Open your hard drive by double-clicking on it.
- Open your Microsoft Office folder. Open the Templates folder inside it.
- You should find a file named
Normal with a Microsoft Word
document icon. Rename this file Old Normal if you have macros
or styles that you would like to save, otherwise, delete it.
- Launch Microsoft Word. Word should take a little longer than normal to start up. Once
Microsoft Word has launched, Microsoft Word will have automatically created a new copy of Normal and saved it into your Templates folder.
If you have macros which you have recorded or written, they are now stored in
Old Normal. You can delete Old Normal after copying all your macros from it.
Creating a macro to insert a MathType equation
To create the macro do the following:
- Launch Microsoft Word.
- From the Tools menu, choose Macro and then Macros to open the Macro dialog.
- In the Macro Name field, type
InsertEquation.
- Under Macros In: it should say "All active templates and
documents".
- Click Create to open a new window.
- Type in the following ,
Sub InsertEquation()
Selection.InLineShapes.AddOLEObject ClassType:="Equation", _
Filename:="", LinkToFile:=False, DisplayAsIcon:=False
End Sub
- From the File menu, choose Close and Return to Microsoft Word.
After you have created the macro for inserting a MathType equation, you can
use the
toolbar button to launch MathType instead of
the Microsoft Equation Editor. To place this button on the toolbar, do the following:
- From the Tools menu of Microsoft Word, choose Customize.
- Select the Commands tab.
- Choose Insert in the list of Categories.
- Choose Equation Editor under Commands. The list is not
in
alphabetical order. Equation Editor appears near the bottom of the list.
- Drag the
icon from the list and drop it on
one the toolbars
where you want the button to be placed. You cannot place the button in a
blank space, it must be placed on an existing toolbar.
- Click Close on the Customize dialog.
If clicking on still launches the Microsoft Equation Editor,
follow the instructions in the following section.
If pressing the toolbar button within Word 98 still launches the Microsoft Equation
Editor, do the following,
- Quit all running applications.
- Launch MathType.
- After MathType has started, select Quit from the file menu.
- Launch Microsoft Word.
Click on the button. MathType
should be launched. If not, please contact
Technical Support.
|