A
Al
I have a Word 2002 document produced from an external application with
many Equation editor objects. However, the equations do not properly
line up with the other text on the line. If I select an equation and open
the Equation editor then close it without making any changes, the
misalignment gets corrected. I need a macro to go through the document
and for each Equation Editor object, open Equation Editor and close it.
I recorded a macro to do this with Find ^g. (I did get help with the
SendKeys to close the application). It works OK until it finds a graphic
which is not Equation Editor then halts. I think I need to add
something like this:
If .Type = msoLinkedOLEObject Then
If .OLEFormat.ClassType = "Microsoft Equation 3.0" Then
But I cannot figure out where and how to do this.
Your help is greatly appreciated.
Sub OpenCloseEqEd()
'
' Macro recorded 2/4/2004
Application.DisplayAlerts = wdAlertsNone
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^g"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
Do While .Execute
Selection.InlineShapes(1).OLEFormat.DoVerb VerbIndex:=1
With Selection.Application
SendKeys "%fx", True
End With
Loop
End With
End Sub
many Equation editor objects. However, the equations do not properly
line up with the other text on the line. If I select an equation and open
the Equation editor then close it without making any changes, the
misalignment gets corrected. I need a macro to go through the document
and for each Equation Editor object, open Equation Editor and close it.
I recorded a macro to do this with Find ^g. (I did get help with the
SendKeys to close the application). It works OK until it finds a graphic
which is not Equation Editor then halts. I think I need to add
something like this:
If .Type = msoLinkedOLEObject Then
If .OLEFormat.ClassType = "Microsoft Equation 3.0" Then
But I cannot figure out where and how to do this.
Your help is greatly appreciated.
Sub OpenCloseEqEd()
'
' Macro recorded 2/4/2004
Application.DisplayAlerts = wdAlertsNone
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^g"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
Do While .Execute
Selection.InlineShapes(1).OLEFormat.DoVerb VerbIndex:=1
With Selection.Application
SendKeys "%fx", True
End With
Loop
End With
End Sub