A
Al
I need a macro to go through a document and open then close every Equation
Editor object. This works until it hits an OLE which is not Equation
Editor.
' Macro1 Macro
' Macro recorded 2/4/2004 by Al
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^g"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute
Selection.InlineShapes(1).OLEFormat.DoVerb VerbIndex:=1
With Selection.Application
SendKeys "%fx", True
End With
Loop
I think I need to add an If statement after my Do While .Execute
like this
If .OLEFormat.ClassType="Microsoft Equation 3.0" Then
Selection.InlineShapes(1).OLEFormat.DoVerb VerbIndex:=1
With Selection.Application
SendKeys "%fx", True
End If
But the editor will not accept this.
Can someone tell me what I am doing wrong?
Thanks.
Editor object. This works until it hits an OLE which is not Equation
Editor.
' Macro1 Macro
' Macro recorded 2/4/2004 by Al
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^g"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute
Selection.InlineShapes(1).OLEFormat.DoVerb VerbIndex:=1
With Selection.Application
SendKeys "%fx", True
End With
Loop
I think I need to add an If statement after my Do While .Execute
like this
If .OLEFormat.ClassType="Microsoft Equation 3.0" Then
Selection.InlineShapes(1).OLEFormat.DoVerb VerbIndex:=1
With Selection.Application
SendKeys "%fx", True
End If
But the editor will not accept this.
Can someone tell me what I am doing wrong?
Thanks.