Friday, 15 May 2015

Escaping from Equation Editor in VBA Word -


I am opening the equation editor program in MS Word using code

  ObjRange = Selection.Range set objRange = Selection.Math Add (objRange) Selection.TypeText text: = "a ^ 2 + b ^ 2 = c ^ 2" Selection.TypeText text: = "1/2" set objEq = objrange.omaths (1) objEq.Type = wdomathInline objEq .buildUp  

Now I want to exit the equation editor so that I can type some regular text. I could not find a direct route. I have an alternative solution, which means to enter it effectively and then going backspace once.

  Selection.Type Paragraph Selection. Mov Left Unit: = wdCharacter, Calculation: = 1  

But is not there a cleaner way?

Thank you.

OK, it's actually very simple Type:

  Selection. Above right unit: = wdCharacter, calculation: = 1  

is created after the equation.


No comments:

Post a Comment