Graham
Your attachment worked a treat and I think that is definitely the way forward so thanks for that (I'm now scratching my head trying to digest Greg Maxey's instructions on how to change the text of the button and add a custom icon, but that's a different story...).

In the meantime I have a further question relating to the second part of my original post, re userforms. I'm not sure if I should start a separate thread for this or not, but as it was part of my original question I'll continue here and I'm sure someone will tell me if I need to move it somewhere else:

I have setup a userform in my custom template from which the user can select one of a number of options, the options being to insert various building blocks. The form itself seems to be working correctly: it looks the way I want, offers the options I want, has a working cancel button (which just closes the form), and pastes the correct building block when I press OK. I have set (or tried to set) the template up so that when a new document is created from it, it automatically displays my userform. I have done this very simply by putting the following code into the ThisDocument object of my custom template (I hope I am using the right terminology to explain this):

Private Sub Document_New()


  frmMyForm.Show


End Sub
The code to actually insert the chosen building block, which I have entered by going to the "View Code" option on my OK button is as follows:



Private Sub cmdOK_Click()


Application.ScreenUpdating = False
If optLetter.Value = True Then
    Me.Hide
    Application.Templates(ThisDocument.FullName).BuildingBlockEntries("1 - Letter").Insert Where:=Selection.Range, _
        RichText:=True
    Else
If optFax.Value = True Then
    Me.Hide
    Application.Templates(ThisDocument.FullName).BuildingBlockEntries("2 - Fax Cover").Insert Where:=Selection.Range, _
        RichText:=True
Else
MsgBox "Option Button has Not been Selected"
End If
End If
Application.ScreenUpdating = True
End Sub
It was adapted from code proposed by Charles Kenyon in another post (unfortunately I cannot give you a link to it as I haven't posted enough messages to this forum yet).

However, I have come up against one infuriating glitch, the solution to which I've no doubt is probably elementary to anyone who actually knows what they're doing. The problem I have is this:
  1. When I first open Word, I get a new blank document (Document1) created using the Normal template, as expected. Thanks to your add-in, the Ribbon shows the custom "Create Company Form" button
  2. When I click on "Create Company Form" button, it successfully creates a new document (Document2) using my custom template.
  3. As soon as Document2 shows up on screen, my userform is displayed.
  4. Whatever building block I select from the form is then successfully inserted into Document 2. So Far, so great.
  5. However, and this is where things start to go wrong, if I then click on the "Create Company Form" button again, whilst it does open another document (Document3), it then switches back to Document2 before displaying the userform, meaning whatever building block I select would be added to Document2 instead Document3. Document3 remains open in the background and I can switch back to it, but the form only shows over Document2.


Search as I might, I cannot work out for the life of me why this is happening. After much trial and error I have noticed that the problem occurs regardless of whether I click "OK" or "Cancel" when my first userform appears on Document2, but if I close the form using the "X" at the top right corner of the form, it does not happen, i.e. if I click on "Create Company Form" again after closing the userform that shows up over Document2 using the "X" on the form, it creates Document3 and then stays on it before opening the userform again, allowing me to correctly insert my desired building block into Document3. I surmise from this that there is probably a key piece of code missing from the code associated with my "cancel" and "OK" buttons that somehow makes sure that the newly created document into which the building block is pasted becomes the "active" document (again, not sure if I am using the right nomenclature, but hopefully I'm making myself clear), rather than the document which was "active" before the "Create Company Form" button was pressed.

I'm sorry if the above explanation seems very complicated but hopefully you've been able to follow me. FYI, my custom template, which contains both the form and the building blocks, is stored in the Microsoft/Templates folder.

Any help or advice on this would be hugely appreciated.
Many thanks.