Adding a Template to a Menu Item

G

Guest

Hi, I was asked if the following situation was possible and my research has
lead me here. My company has created a few templates, and we would like to
add these templates to the "File" menu item, or to a new menu item. Which
ever one is easier to manipulate. So, when a user opens MS word (2003) they
can click on the File menu and when it drops down they should have the option
of clicking on one the templates. This of course opens the correct template.

I hope I have provided enough info.

Thank you in advance

Gurmukh
 
J

Jay Freedman

Certainly it's possible. You need to create a series of macros in a
separate template, each one like this:

Sub NewXXDocument()
Dim templateName As String
templateName = "XX.dot"
On Error GoTo NotThere
Documents.Add Template:=templateName
Exit Sub
NotThere:
If Err.Number = 5151 Then
MsgBox "Template " & templateName & _
" is missing", , "Missing template"
Else
MsgBox Err.Number & vbCr & Err.Description
End If
End Sub

Change the macro's name in the first line and the template name in the
third line for each macro. Then use the instructions in
http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm
to make a menu item for each macro. Use the instructions in
http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm to add
the template to the users' global templates (those in the Word STARTUP
folder).

A completely different, and simpler, alternative is to make a desktop
shortcut for each template. (Locate the template with Windows
Explorer, right-click its icon, and select Create Shortcut. Drag the
shortcut to the desktop.) Double-clicking the shortcut will open Word
with a new document based on the corresponding template.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top