PC Review


Reply
Thread Tools Rate Thread

Word 2007 Macro & quick access toolbar

 
 
Jeff Lowenstein
Guest
Posts: n/a
 
      11th Jan 2008
I would like to create a button on the quick access toolbar that creates a
new document based on a particular template. How do I do this? Please
explain in detail.
 
Reply With Quote
 
 
 
 
Jay Freedman
Guest
Posts: n/a
 
      11th Jan 2008
Jeff Lowenstein wrote:
> I would like to create a button on the quick access toolbar that
> creates a new document based on a particular template. How do I do
> this? Please explain in detail.


Install this macro in your Normal.dotm template (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub MakeMyDoc()
Const MyTemplate = "MyTemplate.dotx"
On Error GoTo ErrHdl

Documents.Add Template:=MyTemplate
Exit Sub

ErrHdl:
If Err.Number = 5151 Then
MsgBox "Could not find " & MyTemplate
Else
MsgBox Err.Number & vbCr & Err.Description
End If
End Sub

Change the filename in quotes from "MyTemplate.dotx" to the actual name of
the template you want the button to use.

Then right-click the Quick Access Toolbar and choose Customize. In the
category dropdown, choose Macros. Select the MakeMyDoc macro and click the
Add button. If you want, you can select the macro name on the right-hand
list and click the Modify button, from which you can change the icon and the
mouseover text for the button.

A small complication: the macro assumes that the template exists in the
folder named as the User Templates folder in the File Locations option
dialog. If you store the template anywhere else, you'll need to include the
full path in the MyTemplate constant, such as

Const MyTemplate = "D:\Extra Templates\MyTemplate.dotx"

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007: Macro Quick Access Toolbar Not Working excellerator General Software 10 13th Aug 2009 12:18 AM
quick access toolbar in Word 2007 =?Utf-8?B?SmFja2llIEQ=?= Microsoft Word Document Management 1 3rd Mar 2007 08:43 AM
RE: quick access toolbar in Word 2007 =?Utf-8?B?UmVuZWUgW01TRlRd?= Microsoft Word Document Management 0 3rd Mar 2007 12:24 AM
Quick Access Toolbar Word 2007 - Way to group buttons? =?Utf-8?B?cmdpbGxl?= Microsoft Word Document Management 1 27th Feb 2007 08:17 AM
can't add "add-ins " toolbar or buttons to quick access toolbar =?Utf-8?B?dWl1YyBxdWVzdGlvbmVlcg==?= Microsoft Word Document Management 4 28th Jun 2006 12:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:48 PM.