Welsh accents

Easy Welsh Accents in Microsoft Word for Free

Yes, it's very possible.

The steps to set it up are a little daunting if you've never tried adding your own macros before. It's well worth it because it makes Welsh accents very simple to use in Word. I have provided great detail and plenty of pictures to help you through the process. If you are not comfortable with following these steps then you should ask someone who isn't afraid of doing things to computers.

Just so you know what this gives you: You will be able to add any of the Welsh accents to vowels by first typing the vowel and then repeatedly pressing Ctrl+#.

By that I mean you press and hold Ctrl, press #, release #, release Ctrl.

This will be available in all Word documents, but not elsewhere in Windows.

Most recent versions of Windows are OK for these instructions. It should be fine with Windows 2000, XP, Vista, 7 and later.


Step 1 - Start Word

Start Microsoft Word.

I am using Word 97 in Windows XP. All the options are available in other versions of Word. They may be a little harder to find.

I've recently used this for Welsh accents in Word 2010 and the macro still works without modification. I will update this page with some new screenshots because the user interface looks so different


Step 2 - Record New Macro

From the menu, select Tools >> Macro >> Record New Macro....


Step 3 - New Macro Name

Word will offer you a new macro called Macro1. If it has a different name in your version, make a note of it because we'll need it later.

Press OK.


Step 4 - Stop Recording

From the menu, select Tools >> Macro >> Stop Recording.


Step 5 - View Macro

From the menu, select Tools >> Macro >> Macros....


Step 6 - Edit Macro

Word will show you all the recorded macros.

Select our macro, which here is called Macro1.

Press Edit.


Step 7 - View Macro Definition

Word will show you a very empty macro in its Visual Basic window.


Step 8 - Select Entire Macro

Select all of Macro1 from the Sub Macro1() line to the End Sub line.


Step 9 - Delete Macro

Delete Macro1 by pressing either the Delete key or the Backspace key.


Step 10 - Insert WelshAccent Macro

Select and copy the following lines and paste them into the Visual Basic window.

Sub WelshAccent()
    ' Welsh accents over vowels
    ' Created 2010 by Patrick Cain
    ' See http://triples.office-on-the.net/welsh/accent.htm
    S = Selection.Start
    If Selection.Start = Selection.End Then Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    L$ = Selection.Text
    L$ = NextAccentedLetter(L$, "A" + ChrW(194) + ChrW(196) + ChrW(193) + ChrW(192))
    L$ = NextAccentedLetter(L$, "a" + ChrW(226) + ChrW(228) + ChrW(225) + ChrW(224))
    L$ = NextAccentedLetter(L$, "E" + ChrW(202) + ChrW(203) + ChrW(201) + ChrW(200))
    L$ = NextAccentedLetter(L$, "e" + ChrW(234) + ChrW(235) + ChrW(233) + ChrW(232))
    L$ = NextAccentedLetter(L$, "I" + ChrW(206) + ChrW(207) + ChrW(205) + ChrW(204))
    L$ = NextAccentedLetter(L$, "i" + ChrW(238) + ChrW(239) + ChrW(237) + ChrW(236))
    L$ = NextAccentedLetter(L$, "O" + ChrW(212) + ChrW(214) + ChrW(211) + ChrW(210))
    L$ = NextAccentedLetter(L$, "o" + ChrW(244) + ChrW(246) + ChrW(243) + ChrW(242))
    L$ = NextAccentedLetter(L$, "U" + ChrW(219) + ChrW(220) + ChrW(218) + ChrW(217))
    L$ = NextAccentedLetter(L$, "u" + ChrW(251) + ChrW(252) + ChrW(250) + ChrW(249))
    L$ = NextAccentedLetter(L$, "W" + ChrW(372) + ChrW(7812) + ChrW(7810) + ChrW(7808))
    L$ = NextAccentedLetter(L$, "w" + ChrW(373) + ChrW(7813) + ChrW(7811) + ChrW(7809))
    L$ = NextAccentedLetter(L$, "Y" + ChrW(374) + ChrW(159) + ChrW(221) + ChrW(7922))
    L$ = NextAccentedLetter(L$, "y" + ChrW(375) + ChrW(255) + ChrW(253) + ChrW(7923))
    If L$ <> Selection.Text Then
        Selection.TypeText Text:=L$
    else
        Selection.Start = S
    End If
End Sub

Function NextAccentedLetter(ByVal current As String, ByVal Letters As String) As String
    ' Pick the next letter following the current letter in a string of letters
    ' Created 2010 by Patrick Cain
    ' See http://triples.office-on-the.net/welsh/accent.htm
    L$ = current
    P% = InStr(Letters, current)
    If P% > 0 Then
        L$ = Mid$(Letters, (P% Mod Len(Letters)) + 1, 1)
    End If
    NextAccentedLetter = L$
End Function

Step 11 - Close Macro Editor

Close the Visual Basic window.

You now have the macro for the accents. You just need to attach it to the keyboard and a toolbar button.

From the menu, choose Tools >> Customize....


Step 12 - Open Keyboard Shortcuts

In the Customize dialog, press the Keyboard... button.


Step 13 - Choose Keyboard Shortcut

In the Categories list, select Macros.

In the Macros list, select WelshAccent.

Click the mouse in the Press new shortcut key box.

Press Ctrl+# (i.e. press and hold Ctrl, press #, release #, release Ctrl).

Why have I chosen Ctrl+#? I chose it because it is easily available on a UK keyboard and Word hasn't already assigned anything to it. You are free to use any key combination you like but you will probably find that Word already has it assigned to another command.


Step 14 - Assign Keyboard Shortcut

Press Assign.


Step 15 - Close Keyboard Shortcuts

You will see Ctrl+# in the Current Keys list.

Press Close.


Step 16 - Customize Toolbar

In the Customize dialog, selct the Commands tab.

In the Categories list, select Macros.

In the Commands list, select Normal.NewMacros.WelshAccent.


Step 17 - Create Toolbar Button

Use the mouse to drag the Normal.NewMacros.WelshAccent and drop it just to the right of the U button.


Step 18 - View Toolbar Button With Text

You will see your macro as a rather big button in the toolbar. Let's make it look better.


Step 19 - Remove Button Text

Right-click on the Normal.NewMacros.WelshAccent in the toolbar and choose Text Only (in Menus).


Step 20 - View Toolbar Button

Your macro button is now a small flowchart picture.


Step 21 - Change Button Picture

Right-click on the flowchart button for Normal.NewMacros.WelshAccent in the toolbar.

Note that there is a menu option called Edit Button Image... You can try this if you're feeling creative.

For now, choose Change Button Image and choose the yellow smiley face. That should be appropriate with how you're feeling when you try this out.


Step 22 - Close Customize

Press Close.


You now have Welsh Accents easily usable in Word.

Close Word and reopen it. This will keep your macro changes.

Try it out by typing GreCtrl+#t, sgiCtrl+#Ctrl+#o, carafaCtrl+#Ctrl+#Ctrl+#n.

Once you've typed a vowel letter, you can repeatedly press Ctrl+# to change the accent, including removing the accent altogether.

If you prefer, you can press the smiley face button on the toolbar rather than using Ctrl+#.

Hwyl!


This page was created in 2010 and is administered by Patrick Cain.
You are free to use and modify its contents but please always acknowledge me as the originator.