Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2019, 11:47 AM
Charles Kenyon Charles Kenyon is offline Multi user template continues to be saved over. Windows 10 Multi user template continues to be saved over. Office 2016
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,584
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Here is a macro that, if placed in a macro enabled template, will create a new document based on the template and close the template if someone opens the template.




Code:
Sub AutoOpen()
      ' Prevent opening of template with macros active
      ' Creates a new document based on the template instead of opening the template
      ' 24 January 2019
      ' Charles Kenyon
      '
      If ActiveDocument.Name = ThisDocument.Name Then
          Documents.Add (ThisDocument.FullName)
          ThisDocument.Close SaveChanges:=False
      End If
  End Sub

I've attached such a template.
Note, to open such a template for editing, you must hold down the Shift key when opening it.

It would need to be stored in a trusted location such as the Workgroup Templates folder. If you place it somewhere not OK'd for macros, then it will open ordinarily and if macros are enabled, the macro would run.
Attached Files
File Type: zip Template That Can't Be Opened.zip (28.1 KB, 10 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi user template continues to be saved over. Custom Template, Multi-List Heading Numbers Reverting to Template Rather than Keeping Local Change whsnow Word 2 03-24-2018 06:57 AM
Multi user template continues to be saved over. Multi-User Authoring jimbassett Word 1 03-26-2015 11:52 PM
Multi-user authoring jimbassett Excel 0 03-26-2015 10:13 PM
Multi user template continues to be saved over. Office Multi User Licence JamesT1 Office 4 05-23-2011 06:19 AM
Merge to New Document - saved letter continues to ask for SQL source Brandi Mail Merge 2 06-16-2010 08:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:45 AM.


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