Monday, September 23, 2013

Creating Macros to Use Within Microsoft Word

One of my favorite discoveries in Microsoft Word was how to use Macros.  These are little programs that you can create that can accomplish several tasks by pushing one button instead of many.

Using the biblical languages as described in the second post can become quite a hassle, especially if you end up having to switch back and forth through the biblical fonts quite often.  So, I created a macro for this that can do it at the touch of a button.

Opening Up the Macro Window


In order to create Macros you have to go to the View tab at the top of your Word screen (I'm using Word 2016).  Click on the "Macros" icon on the right-hand side of the menu, and another screen will pop up that lists all the Macros currently installed in Word.  If you have trouble finding this Macro icon, press Alt+F8 and it should open up.

With the Macro screen open, what we are going to do is create three different macros:
  • A macro to switch to the Hebrew keyboard and font
  • A macro to switch to the Greek keyboard and font
  • A macro to switch to the English keyboard and font
This way, all you will have to do is press one button and you can switch back and forth to Hebrew, Greek, and English.

Creating Macros in Microsoft Word

In this section, we're going to create the three macros above.

Creating Your Hebrew Macro

With the Macro screen open, in the "Macro Name" box type in the name you want for your Hebrew macro.  I chose something simple, like "ToHebrew".  Once you have the name in the box, click on the Create button.  This will take you into the Microsoft Visual Basic developer window, where you can create your macro program.  Your cursor should be blinking with a Macro that starts with "Sub ToHebrew ()" and then has a few lines of green.  Type in the following script to make the Macro read like this:


Sub ToHebrew()
'
' ToHebrew Macro
'
'

    Selection.Font.Name = "SBL BibLit"
    Application.Keyboard (1037)
    Selection.Font.Size = 12
End Sub

Now that you have that typed in, click on the save icon, and close the entire Visual Basic window.  You just created a macro.  Let me explain what you did.  Your macro is set up to change the setting for the font to SBL BibLit.  The "Application.Keyboard" line switches to the keyboard for Hebrew.  If you are wondering where to find this code, it is listed here.  1037 corresponds to Hebrew, 1032 to Greek, and 1033 to English.  The third line specifies which font size you want.  Since I always work in size 12, I have it set to automatically change to size 12.  If you prefer a different font, simply delete "SBL BibLit" and change it to something else, like "SBL Hebrew" or "Ezra SIL". 

Now that you've created your Macro to change to Hebrew fonts and keyboards, you need to follow the same process to create the same ones for Greek and English.  To follow the same naming process, I've used "ToGreek" and "ToEnglish".  These two Macros should look like the following:

Sub ToEnglish()
'
' ToEnglish Macro
'
'

    Selection.Font.Name = "Times New Roman"
    Application.Keyboard (1033)
    Selection.Font.Size = 12
End Sub

Sub ToGreek()
'
' ToGreek Macro
'
'

    Selection.Font.Name = "SBL BibLit"
    Application.Keyboard (1032)
    Selection.Font.Size = 12
End Sub

Creating Your Keyboard Shortcuts

Now that you've created your three language macros ("ToHebrew", "ToGreek", and "ToEnglish"), the final step is creating keyboard shortcuts to run the macro.  Follow these steps to assign your keyboard shortcuts:
  1. Click on the "File" tab in the top-left corner of Word, and then choose "Options" from the box that opens up
  2. Look down the list and click on the "Customize Ribbon." 
  3. At the bottom of the menu box, choose to "Customize" the Keyboard Shortcuts
  4. Under "Categories", scroll down and click on "Macros"
  5. Within the "Macros" box next to the Categories box, you should see your three macros
  6. Click on "ToHebrew"
  7. Put your cursor in the "Press new shortcut key:" box, and choose a shortcut that you will remember to use for this macro.  The tricky part is finding a shortcut that isn't already being used.  On my computer, Alt+H had not been assigned to anything, so I used that for my ToHebrew macro.  Once you find a shortcut that isn't being used by another function, click on the "Assign" box to assign that shortcut to the ToHebrew macro.
  8. Do the same thing for "ToGreek."  Click on it, and then input a keyboard shortcut.  On my computer, Alt+G had not been used for anything, so I assigned that shortcut for ToGreek.
  9. And finally, do the same thing for "ToEnglish."  I used Alt+E.
  10. Once you've assigned shortcuts to your three macros, close the Word Options box and go back to your document.
Now, you should have all your macros created and assigned keyboard shortcuts.  Start typing in English, and the press the shortcut for Hebrew that you just created (Alt+H on my computer).  This should change your keyboard to Hebrew, and your font to whatever Hebrew font you used.  Now, start typing in Hebrew.  To change back to English and Times New Roman (or whatever English font you used), simply press Alt+Q (or whatever shortcut you decided on).  Now, you can continue typing in English.

Where Microsoft Word Can Be Fickle

Having used these Macros for some time now, I have noticed that they can be a bit fickle.  Here are some of the problems I've noticed, that are more annoyances than anything else.
  • Sometimes, when I haven't used Hebrew yet, the first time I press the shortcut, it will change to the Hebrew keyboards, but not to the Hebrew font.  What I've noticed is that if you select your font from the font list during this first time using the Macro, it will work fine from that point on.  It's weird, I know, but hey, it's still quicker than doing it manually every time.
  • Sometimes, when using Hebrew, the macro will automatically change it to 16 point font instead of 12 point font.  I have no idea why this is, but just like above, if I change it to 12 point during the first go around, it will work fine from that point forward.
  • Sometimes when changing back to English from Greek, the macro will not work the first time I press the shortcut.  If I press the shortcut a second time, it will work perfectly.  Weird quirk, and still not sure why this happens.  So I just get used to pressing the English shortcut twice.
OK, so that's it.  I hope this little guide has been helpful.  Let me know if you have any other troubles, and I'll do my best to update my little guide here.









Using the Biblical Fonts in Microsoft Word

Now that you have downloaded and installed the fonts and keyboards for the biblical fonts, let's put them to good use.

In this post, I'm going to show you how to use the biblical fonts through a couple of easy steps.  In the next, I'm going to show you how to create Macros in Microsoft Word to make using the fonts even easier.  I suggest learning both methods first, and then choosing whichever one you find easiest (I like the macro version).

Using the Biblical Fonts

Using the biblical fonts in Microsoft is fairly easy. In order to type in a biblical font, Microsoft Word needs you to pair up one of the language keyboards with a font.  So, in order to type in Hebrew in Microsoft Word, you need to choose the Hebrew keyboard as well as a Hebrew font.  The same with Greek.

First things first, open up a new document.  Once the document is open, the first thing you need to learn how to do is switch between which keyboard you want to use.  There are two ways to do this.

Switching Keyboards Using the Language Bar

The first way to switch keyboards is using the language bar.  If you followed the instructions in the previous post, your language bar should already be located on the taskbar at the bottom of your screen, left of the clock/date.  It should be set to read "EN" and might have a keyboard icon next to it.  To change your keyboard, click on the "EN".  A box should pop up and give you all the different keyboard options that have been installed or added by you.  There should at least be English, Hebrew, and Greek on the list.  Simply click on whatever language you want to type in.  That's it, pretty easy.

Switching Keyboards Using the Keyboard

A second way to switch keyboards is to press Alt+Shift within Microsoft Word.  Each time you do this, your keyboard setting will go through the list of different languages in the Language Bar.  In other words, with the Word screen opened, if your keyboard is set to "EN", then press Alt+Shift.  The "EN" should change to either "HE" (Hebrew) to "EL" (Greek).  If you press it again it will switch to the third language, and then once more and it will switch back to English.  Pretty easy, huh?


Switching Fonts to Type in a Biblical Language

Once you have chosen your keyboard, the final step is choosing the correct to go along with it.  For the Hebrew keyboards, the two fonts you can use are SBL Hebrew and SBL BibLit.  For the Greek keyboards, the two fonts you can use are SBL Greek and SBL BibLit.  So, if you only installed SBL BibLit, you should be good to go.  Again, some people prefer to use the SIL fonts rather than the SBL ones.  It's really only a matter of preference, as both fonts are designed very well.  The SIL fonts are designed to look closer to the fonts you find in your typical critical editions of the Bible (e.g. BHS).


Once you've matched up your keyboard and font, you should be able to type in Greek and Hebrew!  The final step is learning where all the different letters and vowels and various marks are on your new keyboards.  This will take some practice, but isn't too hard.  Also practice switching back to English by choosing the EN keyboard and going back to your English font (e.g. Times New Roman).

You should now be able to type a sentence in English, quote the biblical text, and then go back to English all on the same line.

Downloading and Installing Fonts and Keyboards

Several years ago I was taught how to install and use the biblical fonts in Microsoft Word.  It has made the use of these fonts in papers and articles very fluid and easy.  The point of this blog is to offer up how to do the same for others who want to use these fonts in their own work and research.

One caveat, I am using a PC with Windows 7 installed on it.  I know that the biblical fonts are a bit different for those using a Mac OS, so sorry I can't be of any help there.  And don't ask me if I can help, I cannot.  And frankly, I have no need to learn, so I'm not going to research it for you either.  So, unless by some magical coincidence these instructions work for a Mac, they are only intended for PC users.

Step One:  Downloading Necessary Fonts

The first step in using the biblical fonts is downloading them and installing them.  This is very straightforward and easy on a PC.  The font package I have enjoyed the most is the one made available by SBL.  They have three biblical fonts available for use: SBL Greek, SBL Hebrew, and SBL BibLit (containing both Hebrew and Greek).

The SBL Greek font package is available here.
The SBL Hebrew font package is available here.
The SBL BibLit font package is available here.

Another set of popular Greek and Hebrew fonts are from SIL.  The SIL Hebrew font is called Ezra SIL, and can be found here.  The SIL Greek font is called Galatia SIL, and can be found here.

When you go to each of these websites, download the fonts following the directions on the website.  I typically save straight to my desktop

Step Two:  Installing Necessary Fonts

The second step is installing the necessary fonts.  Once downloaded, go to your desktop and find the icons for the three (or five) fonts you downloaded.  For each font, right-click and choose "Install."  It will take a few seconds for each font.  That's it.  Your fonts are installed.


Step Three: Installing the Necessary Keyboards

Now that you have the fonts installed, it is important to install the keyboards for which the fonts were designed to be used.  The two keyboard drivers you will need to install are the Hebrew and English Transliteration keyboards.  The Hebrew one is found at the SBL Hebrew site above, and the English Transliteration at the SBL BibLit site above.

Installing Hebrew Keyboards

If you have not downloaded the Hebrew keyboard file yet, go back to the link above and download either the SBL or Tiro keyboard packages.  Go to the place you downloaded the file to, and unzip it.  Once unzipped, open up the PDF file for the Manual (should be included in the ZIP file).  Once opened, simply follow the directions in the manual for installing the keyboard.  Looking quickly over the manual, all you have to do is double-click on "Setup.exe" and it will automatically install the correct keyboard to your computer.

Installing Greek Keyboards

You have probably noticed that no Greek keyboards were available from the SBL website.  Don't freak out, it is already installed on your PC.  To make it available for use, all you have to do is turn it on.  Here's the instructions for doing that:
  1. Open your Control Panel
  2. Click on "Clock, Language, and Region"
  3. Click on "Change keyboards or other input methods"
  4. Under the "Keyboards and Languages" tab, click on "Change Keyboards..."
  5. Under the "General" tab, click on the "Add..." button
  6. Scroll down until you find "Greek" and then click on the "+" button
  7. If it isn't already expanded, also click on the "+" button for "Keyboards"
  8. Put a check in the "Greek Polytonic" box, then click "OK"
 This will bring you back to "Text Services and Input Languages" window.  While there, make sure that your Language Bar is docked in the taskbar.  To do this, click on the "Language Bar" tab, and make sure that the radio button is set to "Docked in the taskbar".

Installing Transliteration Keyboards

There is one more keyboard to install, and that is the transliteration keyboard for English.  Go to the link above for the SBL BibLit font, and download the ZIP package for the transliteration keyboard.    Unzip the file and, just like the Hebrew font above, click on "Setup.exe" to install the keyboard package.