use Building Blocks to quickly add diagrams, text or tables

If you select any part of a Word document (diagram, text, table or any combination thereof) then press Alt+F3 (or Alt+Fn+F3) the selected area is copied to Building Blocks and you can name that selection in the table brought up. Then in any future document you only need to write the name and, with the cursor after the name, press F3 (or Fn+F3) to call up that diagram, text or table. This saves a huge amount of time when producing resources.

When you are typing the name of the Building Block for insertion, a ghostly-grey box appears above the writing – click on it before you have even finished writing the name and the Building Block appears.

Some possible uses are:

1. Instantly calling up a table rather then having to make it from scratch, as detailed here.

2. When I type ethylbenzene followed by F3 the word ethylbenzene is replaced by

3. When I type nucleophilic substitution followed by F3 the words nucleophilic substitution are replaced by

4. When I type heat under reflux followed by F3 the words heat under reflux are replaced by

5. Every Departmental meeting has the same format which I used to copy from last week’s Departmental meeting. Now I just type Chem Dept Meeting followed by F3 and the words Chem Dept Meeting are replaced by

6. Our end-of-topic tests have a text-box and the school logo at the top of the first page. I used to copy both of these from a different test but now I type test heading followed by F3 and the words test heading are replaced by

use a non-breaking space

When you are producing a resource you don’t want a number at the end of a line with its unit on the next line or, even worse, the unit being split over two lines as in these examples:

To avoid this, don’t use a normal space between 0.25 and mol and dm–3. Instead use a non-breaking space by pressing Ctrl+Shift+spacebar. It looks exactly the same but the whole thing will not be spread over two lines so will look like this:

restore underlining and blue font in hyperlinks

Sometimes the hyperlinks in a document lose the blue font and the underlining – the hyperlink still works but it’s difficult to tell it is there. The method for bringing back the blue font and the underlining is in Rhonda’s excellent newsletter https://cybertext.wordpress.com/about/ which always has fantastic Word tips. This one she got from Suzanne S Barnhill, as explained here: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other-mso_2010/making-links-in-word-blue/bf5d471d-4a5f-4037-8e42-372de429864f

1.   Display field codes using Alt+F9 (or Alt+Fn+F9). This will make your hyperlinks display as field code so wordpress.com/home/southampton-exam-factory.com will change to { HYPERLINK “https://wordpress.com/home/southampton-exam-factory.com” }

2.   Press Ctrl+H to open the Replace dialog.

3.   Click More to expand the dialog.

4.   In the ‘Find what’ box, type ^d HYPERLINK. ^d represents any field code, and therefore ^d HYPERLINK looks for a HYPERLINK field code.

5.   With the insertion point in the (empty) ‘Replace with’ box, click Format, then Style.

6.   Select the Hyperlink style (it’s a long way down) and click OK.

7.   Click Replace All.

8.   Press Alt+F9 (or Alt+Fn+F9) again to toggle the field display back to results which has blue underlined hyperlinks.

add a commonly-used table

I watched my colleague Alun Dear laboriously make a bond energy table from scratch, with column headings centralised in bold but the bonds justified left. I realised that every time he made a table for one of his wonderful resources he had to go through the same process every time. ‘Why don’t you just save your table in Building Blocks like this?’ I asked. ‘As long as you can remember what you called your table, all you have to do is type its name then press F3 and the name changes to the table, formatted and complete with all the bond energies. Do the same for electrode potential, subatomic particles, etc. You can have any table you want at the click of a button.’ Building Blocks can also be used to quickly add text or diagrams or any combination of text, diagrams and tables as described here.

(Use the macro here to make a nice electrode potential table. All of the equilibrium signs are underneath each other since they are in their own invisible column without borders.)

  1. Select the entire table:

2.    Press Alt+F3 (or Alt+Fn+F3). Word displays the Create New Building Block dialog box:

3.    Replace the contents of the Name field with the name you want to use for your table.

4.    Click on OK.

5. When you later want to use the table, simply type the name you specified in step 3 and press the F3 key (or Fn+F3).  The table will be inserted in the place of the table name.

change the format of a question to AQA-style

Here at Southampton Exam Factory we do AQA at GCSE. The style of questions is that the marks for a question are at the end of the question, not the student’s answer, and the students write on solid lines:

We take questions from other exam boards and modify them to make them fit our syllabus. Usually the questions have dotted lines for the student’s answer and have the marks available at the end of the student’s answer:

The macro below will replace all dotted lines with solid lines and move the [2] at the end of the answer to a [2 marks] at the end of the question. This makes it much quicker to produce good resources for the students.

Sub ReplaceDottedLinesWithSolidLines()


 'replace question numbers with line
    Selection.WholeStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "\[2\]"
        .Replacement.Text = _
            "[2 marks] __________________________________________________________________________"
                
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    
         Selection.Find.Execute Replace:=wdReplaceAll
         
   'replace question numbers with line
    Selection.WholeStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "\[1\]"
        .Replacement.Text = _
            "[1 mark] __________________________________________________________________________"
                
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    
         Selection.Find.Execute Replace:=wdReplaceAll
          
    'replace question numbers with line
    Selection.WholeStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "\[3\]"
        .Replacement.Text = _
            "[3 marks] __________________________________________________________________________"
                
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    
         Selection.Find.Execute Replace:=wdReplaceAll
          
    'replace question numbers with line
    Selection.WholeStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "\[4\]"
        .Replacement.Text = _
            "[4 marks] __________________________________________________________________________"
                
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    
         Selection.Find.Execute Replace:=wdReplaceAll
    
    
    'align right
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find.Replacement.ParagraphFormat
        .SpaceBeforeAuto = False
        .SpaceAfterAuto = False
        .Alignment = wdAlignParagraphRight
    End With
       
  'remove dots
   'Selection.WholeStory
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Copy
    
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ".."
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    
    'remove autocorrected dots
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Copy
    
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "…"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    'remove single dot before question marks
    Selection.WholeStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ". \["
        .Replacement.Text = "["
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ". \["
        .Replacement.Text = "["
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    

End Sub

add powers to a maths equation no.2

The macro below will produce the powers in a maths equation by making the powers size 8 and raising them by 2 points. To do this, put a ‘z’ in front of anything you want to be a power. For anything that you want to be a subscript put a ‘q’ in front of it and it will be lowered by 2 points and made size 8. So to make the following equation:

first insert a fraction from Insert>Equation:

then type (pSOq3)z2 on the top line and (pSOq2)z2 (pOq2) on the bottom line. Then run the macro below. It will also change Cambria Math (sic) font to Arial and get rid of the italics.

Sub MathsEquationsRaisePowersWithZ()

 Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find.Replacement.Font
        .Size = 8
        .Superscript = False
        .Subscript = False
        .Position = 1
    End With
    With Selection.Find
        .Text = "([z])([-])"
        .Replacement.Text = "\2"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find.Replacement.Font
        .Size = 8
        .Superscript = False
        .Subscript = False
        .Position = 2
    End With
    With Selection.Find
        .Text = "([z])([0-9])"
        .Replacement.Text = "\2"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find.Replacement.Font
        .Size = 8
        .Superscript = False
        .Subscript = False
        .Position = -2
    End With
    With Selection.Find
        .Text = "([q])([0-9])"
        .Replacement.Text = "\2"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
      
   For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Italic = False
    Next equation
    
    'Selection.TypeText Text:=" "
    
    For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Name = "Arial"
    Next equation
          
End Sub

the Arrhenius equation

In the Arrhenius equation the activation energy has a subscript but is itself a superscript:

The best way to write it in Arial font size 11 is to have the exponential factor raised by 2 points but the small ‘a’ in size 8 and raised by only 1 point. The first code below will write the above with just 3 clicks – one to call up the list of macros, one to select the Arrhenius equation and one to run it.

The second code below will write the natural log version of the Arrhenius equation:

Sub ArrheniusEquation()
Selection.TypeText Text:="k = Ae"
    Selection.Font.Superscript = wdToggle
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 2
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    Selection.TypeText Text:=ChrW(8211) & "E"
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 1
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    Selection.Font.Size = 8
    Selection.TypeText Text:="a"
    Selection.Font.Size = 11
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 2
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    
      
    With Selection.Font
        .Name = "Arial"
        .Size = 16
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = -1
        .Scaling = 100
        .Position = -1
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    
    Selection.TypeText Text:=" /"
    Selection.Font.Superscript = wdToggle
    
    
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 2
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    
    Selection.TypeText Text:=" RT"
    'Selection.Font.Superscript = wdToggle
    
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = False
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 0
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    
    Selection.TypeText Text:=" "
End Sub
Sub ArrheniusEquationNaturalLog()

 Selection.TypeText Text:="ln k = " & ChrW(8211) & " "
    
    Selection.OMaths.Add Range:=Selection.Range

    Selection.OMaths(1).Functions.Add(Selection.Range, wdOMathFunctionFrac). _
        Frac.Type = wdOMathFracBar
    Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdMove
    Selection.Font.Name = "Arial"
    Selection.TypeText Text:="Exxza"
    
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    Selection.Font.Name = "Arial"
    Selection.TypeText Text:="RT"
    
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    
    For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Name = "Arial"
    Next equation
    
    For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Italic = False
   Next equation
    
  Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find.Replacement.Font
        .Size = 8
        .Superscript = False
        .Subscript = False
        .Position = -1
    End With
    With Selection.Find
        .Text = "(xxz)(a)"
        .Replacement.Text = "\2"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    Selection.Font.Italic = wdToggle
    Selection.Font.Name = "Arial"
     Selection.TypeText Text:="+ ln A"
     
     For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Name = "Arial"
    Next equation
End Sub

delete all headers and footers

Here at Southampton Exam Factory we have a lot of resources from an exam board for a now-defunct specification. The resources all have several footers and headers in gaudy textboxes with logos. Nobody cares now which section of the defunct syllabus the resources were created for. The macro below will remove them all with one click.

Sub RemoveHeaderAndFooter()

Dim oSec As Section
Dim oHead As HeaderFooter
Dim oFoot As HeaderFooter

For Each oSec In ActiveDocument.Sections
   
   For Each oHead In oSec.Headers
   If oHead.Exists Then oHead.Range.Delete
   Next oHead

   For Each oFoot In oSec.Footers
   If oFoot.Exists Then oFoot.Range.Delete
   Next oFoot
   
Next oSec

End Sub

add batch AutoCorrect entries

As explained here, AutoCorrect can be used to type in unformatted chemical formulae which then automatically add the correct subscripts and superscripts, or to type in an abbreviation which automatically expands to the long word or phrase. But it takes a long time to add each entry individually.

The link below is to a file created by Dave Rado:

https://wordmvp.com/Downloads/AutoCorrect.zip

Download the file and save it to your laptop. Opening the document will give you this message:

Pressing Backup will export your AutoCorrect table which can then be saved. Dozens of entries can then be added at the same time. Next time you open the document in the file above, press Restore and your expanded table is imported. Over time you can add hundreds of entries very easily.

The website below explains how to achieve the same result with a macro on the Quick Access toolbar:

add powers to a maths equation

When you make an equation using Insert>Equation you can’t use superscripts to get the powers. If you try to make the powers in a smaller font it just makes the whole expression into the smaller font. My colleague Lara Dune asked me how I produce such beautiful script as:

I used to place the expression over two lines with a line drawn in. Then I found that I could dispense with the line by underlining the top line of the expression, but this went awry when underlining the powers. Inserting a maths equation looks a lot better because it straddles the line as above, but the powers are then a problem. So I use the macro below which inserts the dummy expression above with the powers raised by 3 points and in font 8, while the remainder of the equation is in font 11. Change the characters to the ones you want then run the macro here over it to convert it to Arial.

If you are producing equilibrium resources and want an expression like this:

the minus sign has to be raised by 1.3 points.

Sub MathsEquationSuperscript()

Selection.OMaths.Add Range:=Selection.Range

    Selection.OMaths(1).Functions.Add(Selection.Range, wdOMathFunctionFrac). _
        Frac.Type = wdOMathFracBar
    Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdMove
    Selection.Font.Name = "Arial"
    Selection.TypeText Text:="[P]zxz2"
    
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    Selection.Font.Name = "Arial"
    Selection.TypeText Text:="[Q]zxz3"
    
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    
    For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Name = "Arial"
    Next equation
    
    For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Italic = False
   Next equation
    
  Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find.Replacement.Font
        .Size = 8
        .Superscript = False
        .Subscript = False
        .Position = 3
    End With
    With Selection.Find
        .Text = "(zxz)([23])"
        .Replacement.Text = "\2"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
End Sub