Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2022, 09:02 AM
Cosmo Cosmo is offline Removing CustomUI when saving word file from template Windows Vista Removing CustomUI when saving word file from template Office 2007
Competent Performer
Removing CustomUI when saving word file from template
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default



Quote:
Originally Posted by Italophile View Post
It has always been the case that when a document is created from a template it inherits the content of the template except:
  • VBA code
  • ribbon xml
  • building blocks
Those items stay in the template and will be available to the document whilst it remains attached to the template.

I rarely build templates that contain customized ribbon code but occasionally it has been necessary. In the interests of science I just created a document from an old template I created for a client that was using Wd2010. I then compared that to an example document I created from the same template back in 2016. To my surprise the new document contained the ribbon xml whilst the old document didn't.

As I am now using O365 I can only conclude that in Microsoft's infinite wisdom they decided to change how this works at some point. Either that or they've introduced a bug.
Ok. So, I'm NOT going crazy. Everything I had read indicated that saving a document from a template would strip out the UI elements, and what you are saying tracks with what I have experienced.

I believe I have a working solution for now, might not be the best but it seems to work to get a usable template for next week. I can update the procedure at a later date if necessary.

When I finish my working template with all code and CustomUI elements, I will make a duplicate of that UI file, strip out the CustomUI elements. The 'Doc-Template.dotm' file will be added to the 'Templates' folder, the 'Doc-Template-UI.dotm' and an alias to the 'Doc-Template.dotm' file will be added to the 'Startup' folder. I have adjusted the code to create a new document from the UI to search the Application.Templates for the correct template file instead of using 'ThisDocument' so that it will use the non-UI template. This allows me to maintain a single template that has all elements necessary for that specific document.

This does mean that there are 2 templates with identical code, but that's not an issue to me. The only issue would be if i need to submit an update to the template, and someone updates one but not the other. This shouldn't be a problem for PC users, as I will be creating an installer to handle that, but for now, i will need Mac users to update the files manually. I will need to look into a similar process for Mac.

Thanks for the assistance, I will look more into the Templates discussion Charles linked to earlier when I have more time to dedicate.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Notes View into Word Template caz46 PowerPoint 0 06-24-2015 01:29 AM
Removing digitally signing when saving plasma Word 0 05-26-2015 08:36 AM
Saving a template file dreamz Word VBA 10 06-26-2014 04:38 AM
Removing CustomUI when saving word file from template Looking for best way to remove VBA and CustomUI from a file via VBA Cosmo Word VBA 1 04-25-2014 06:19 PM
Update Document Template when Saving the Document File bjbercaw Word 3 11-16-2010 02:03 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:54 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