write E cell with a standard sign

The macro below will generate the symbol above.

Sub ECell()

Selection.OMaths.Add Range:=Selection.Range
Selection.OMaths(1).Functions.Add(Selection.Range, _
        wdOMathFunctionScrSubSup).ScrSubSup.AlignScripts = False
Selection.MoveLeft Unit:=wdCharacter, Count:=3
Selection.TypeText Text:="E"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeText Text:="cell"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=ChrW(415)
Selection.MoveRight Unit:=wdCharacter, Count:=1
       
Dim equation As OMath
For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Italic = False
Next equation
    
For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Size = 12
Next equation

Selection.Font.Name = "Arial"
Selection.Font.Size = 11
Selection.TypeText Text:=" "
   
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: