Overbar Macro

I have often found it annoying to have to insert overbars manually in MS word for things like logic signals. Today I wrote a three line macro to do it. With this macro you select the text that you would like an overbar over and run the macro. That’s it.

If you want to use this macro but don’t know how to add macros to MS Word, leave a comment and I will try to explain.

Sub overbar()
Dim sText As String
sText = Selection.Text

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
“EQ  \x\to(” & sText & “)”, PreserveFormatting:=False
End Sub

One Response to Overbar Macro

  1. David Govett says:

    Thanks for your work.

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 )

Twitter picture

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

Facebook photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.