#1
|
|||
|
|||
Macro for opening a blank Word document from My Templates (Mac)
Hi everyone,
I am using Mac Office 2011. I regularly need to open and create new Word documents, using a customized template I created. Usually, I have to go to File - New from template. The default choice is 'Print Layout View', I then have to navigate to the item above it - My Templates and then choose the template I created. Because I do this lot, I am trying to look for a way to automate the process. I know that to open a blank word document, you can use a shortcut: Command + N in Word. But there is no corresponding shortcut for directly opening my customized template. There is a shortcut for 'New from template' (Shift + Command + P), but I still have to use the mouse to navigate to My Templates and choose the specific template. Is there a way to automate what I describe in the second paragraph? I tried recording a Macro while performing the steps, but it did not come out as what I wanted - instead of opening the customized template, it just opened a blank document. The VBA code from that recorded macro is provided below (I tried it twice, and it's the same): Documents.Add Template:="Normal.dotm", NewTemplate:=False, DocumentType:=0 I have also tried the following 2 codes, after doing some googling online: Documents.Add Template:=“Name of my template.dotx” Documents.Add("Name of my template.dotx") Neither of these works (note, I replaced the Name of my template with the actual name of the template) Could anyone please help me with the macro? It would make my life really easier. Thanks a lot! |
#2
|
|||
|
|||
Why not just place a shortcut to the Template file on your Desktop? I'm not familiar with 'Mac Terms' But opening a template file from Windows Explorer is the same as going to File | New in word.
|
#3
|
|||
|
|||
Thank you for your reply. I did encounter this suggestion while googling for a solution. However, even if it were to work, I would still need to go to the desktop and open the shortcut. This would not be substantially different from what I have to do now. What I am looking for is a way to open the customized template without interrupting my workflow (when I am working in Word).
|
#4
|
|||
|
|||
Sorry, I misunderstood what you were trying to do.
I just recorded a macro to open a template I use. I'm in Windows, but could be slightly different under Mac. It looks like the below Code:
Public Sub OpenTemplate() ' ' Macro1 Macro ' ' Documents.Add Template:= _ "C:\Users\paul.muldoon\Documents\Custom Office Templates\Blank_Report_Template.dotm" _ , NewTemplate:=False, DocumentType:=0 End Sub Code:
Sub AutoExec() With Application ' \\ Do customization in THIS document ' .CustomizationContext = ThisDocument ' \\ Add keybinding to this document Shorcut: Control-Alt+L .KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyControl, wdKeyAlt, wdKeyL), _ KeyCategory:=wdKeyCategoryCommand, _ Command:="OpenTemplate" End With End Sub |
#5
|
|||
|
|||
Thanks Paul. But sorry that did not work for me. I did replace your file path with mine, but it just returned with errors when I ran the macro.
Quote:
|
#6
|
|||
|
|||
Can you post the full code of your macro? And I assume your are saving it as a macro enabled file in your word start up folder?
|
#7
|
|||
|
|||
Hi, sure. Here is the full code of the macro:
Sub Macro1() ' ' Macro1 Macro ' ' Documents.Add Template:= _ “Macintosh HD:Users:benyin:Library:Application Support:Microsoft:Office:User Templates:My Templates:MBA personal doc template.dotx" _ , NewTemplate:=False, DocumentType:=0 End Sub The macro is saved in 'All active templates and documents' |
Tags |
new document, open, template |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need Help With Opening a Word Document | PosseJohn | Word VBA | 1 | 12-06-2013 01:16 PM |
Opening PPT without a blank slide | Welshie82 | PowerPoint | 4 | 09-30-2013 03:28 PM |
All my word documents are opening as blank. | Omni1 | Word | 1 | 07-14-2011 04:23 PM |
Word document not opening | 7beats | Word | 2 | 04-16-2010 12:40 AM |
Opening word document problem | SPARKY77 | Word | 4 | 11-02-2009 01:34 AM |