Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2015, 05:59 AM
yinswenti yinswenti is offline Macro for opening a blank Word document from My Templates (Mac) Mac OS X Macro for opening a blank Word document from My Templates (Mac) Office for Mac 2011
Novice
Macro for opening a blank Word document from My Templates (Mac)
 
Join Date: Feb 2015
Posts: 4
yinswenti is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 02-07-2015, 08:51 AM
ptmuldoon ptmuldoon is offline Macro for opening a blank Word document from My Templates (Mac) Windows 7 64bit Macro for opening a blank Word document from My Templates (Mac) Office 2013
Advanced Beginner
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 02-07-2015, 09:03 AM
yinswenti yinswenti is offline Macro for opening a blank Word document from My Templates (Mac) Mac OS X Macro for opening a blank Word document from My Templates (Mac) Office for Mac 2011
Novice
Macro for opening a blank Word document from My Templates (Mac)
 
Join Date: Feb 2015
Posts: 4
yinswenti is on a distinguished road
Default

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).

Quote:
Originally Posted by ptmuldoon View Post
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.
Reply With Quote
  #4  
Old 02-07-2015, 11:08 AM
ptmuldoon ptmuldoon is offline Macro for opening a blank Word document from My Templates (Mac) Windows 7 64bit Macro for opening a blank Word document from My Templates (Mac) Office 2013
Advanced Beginner
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default

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
I have that included in a Word Add-In in my Word Startup folder. I then added a button to the QAT to call that macro, which opens the Report Template. You could also likely recorded a KeyStroke Short cut and place it AutoExec Macro

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
Reply With Quote
  #5  
Old 02-08-2015, 12:11 AM
yinswenti yinswenti is offline Macro for opening a blank Word document from My Templates (Mac) Mac OS X Macro for opening a blank Word document from My Templates (Mac) Office for Mac 2011
Novice
Macro for opening a blank Word document from My Templates (Mac)
 
Join Date: Feb 2015
Posts: 4
yinswenti is on a distinguished road
Default

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:
Originally Posted by ptmuldoon View Post
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
I have that included in a Word Add-In in my Word Startup folder. I then added a button to the QAT to call that macro, which opens the Report Template. You could also likely recorded a KeyStroke Short cut and place it AutoExec Macro

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
Reply With Quote
  #6  
Old 02-08-2015, 06:51 AM
ptmuldoon ptmuldoon is offline Macro for opening a blank Word document from My Templates (Mac) Windows 7 64bit Macro for opening a blank Word document from My Templates (Mac) Office 2013
Advanced Beginner
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default

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?
Reply With Quote
  #7  
Old 02-08-2015, 08:10 AM
yinswenti yinswenti is offline Macro for opening a blank Word document from My Templates (Mac) Mac OS X Macro for opening a blank Word document from My Templates (Mac) Office for Mac 2011
Novice
Macro for opening a blank Word document from My Templates (Mac)
 
Join Date: Feb 2015
Posts: 4
yinswenti is on a distinguished road
Default

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'


Quote:
Originally Posted by ptmuldoon View Post
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?
Reply With Quote
Reply

Tags
new document, open, template

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for opening a blank Word document from My Templates (Mac) Need Help With Opening a Word Document PosseJohn Word VBA 1 12-06-2013 01:16 PM
Macro for opening a blank Word document from My Templates (Mac) Opening PPT without a blank slide Welshie82 PowerPoint 4 09-30-2013 03:28 PM
Macro for opening a blank Word document from My Templates (Mac) 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft