Word Macro, Recording Stops in Eqn Editor

M

Matt Waldron

I am using Math Type 5 in Microsoft Word. I want to take
a Word file with many equations in it and use a macro to
automate the saving of equations to a folder.

The macro I worte searches for next equation, opens
it, "saves copy as" a gif file using automatic numbering,
deletes the equation and replaces it with a tag (e.g.
[img:"eqn1.gif"], [img:eqn2.gif"] and so on.)

The macro handles everything fine but recording stops for
all the keyboard commands I use while in Math Type 5 in
Word while the equation is open.

The result is all the equations get replaced by the tags
I want but no equations get saved to the folder.

Is there a way to automate the saving of many equations
to solve my problem?

Thanks,

Matt Waldron
 
J

Jezebel

Word has no direct access to the commands you're using while you have
another application active, even if that application's output is embedded in
Word. Your best bet is probably SendKeys. Work out the Math Type instruction
sequence as a list of keystrokes (no mouse operations), then at the critical
point in your macro insert a SendKeys instruction with the required
keystrokes, and Wait set to true.

Bear in mind that Word (ie your macro) gets no message if there is an error
in MathType while this is going on.
 
M

Matt Waldron

Hi,
Thanks for your idea but I could not get the SendKeys
keystrokes passed to MathType. I could not get MathType
to be the active window. Since I know virtually nothing
about VB, it's probably something simple. Do you know
how? Thanks, Matt Waldron
-----Original Message-----
Word has no direct access to the commands you're using while you have
another application active, even if that application's output is embedded in
Word. Your best bet is probably SendKeys. Work out the Math Type instruction
sequence as a list of keystrokes (no mouse operations), then at the critical
point in your macro insert a SendKeys instruction with the required
keystrokes, and Wait set to true.

Bear in mind that Word (ie your macro) gets no message if there is an error
in MathType while this is going on.



I am using Math Type 5 in Microsoft Word. I want to take
a Word file with many equations in it and use a macro to
automate the saving of equations to a folder.

The macro I worte searches for next equation, opens
it, "saves copy as" a gif file using automatic numbering,
deletes the equation and replaces it with a tag (e.g.
[img:"eqn1.gif"], [img:eqn2.gif"] and so on.)

The macro handles everything fine but recording stops for
all the keyboard commands I use while in Math Type 5 in
Word while the equation is open.

The result is all the equations get replaced by the tags
I want but no equations get saved to the folder.

Is there a way to automate the saving of many equations
to solve my problem?

Thanks,

Matt Waldron


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top