Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2022, 07:50 PM
Guessed's Avatar
Guessed Guessed is offline Removing CustomUI when saving word file from template Windows 10 Removing CustomUI when saving word file from template Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

My experience with CustomUI ribbons and templates has been to always put the code (vba and customUI) into the 'attached' template because that is where the applicability matches and there is rarely a reason to complicate the system by implementing partner addins to match the 'attached' template.



However I have seen particular users create documents from templates which accidently get a copy of the CustomUI embedded in the docx file. This happens when their workflow is to OPEN the template and then do a SaveAs to turn it into a docx file. In this special case the CustomUI xml is included in the docx file although any macros would be stripped out as they save unless they choose docm as the format.

I have not yet seen a template with embedded customUI code produce new documents with contained customUI when the documents are created the RIGHT way (File>New or double clicking a dotm file). It is possible that this functionality has been broken on a recent update of Word 365 but I still haven't seen it.

I do wonder why you would put the source new document template in your startup folder instead of the more usual User/Workgroup templates folder. This might be interfering with the code you say you are using
Code:
Application.Documents.Add(Template:=ThisDocument.FullName, visible:=True)
Is that creating an unsaved DocumentX file or is it opening the template itself which you then SaveAs? Opening the template would cause the CustomUI to be replicated in the resulting file.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 09-18-2022, 01:34 AM
Italophile Italophile is offline Removing CustomUI when saving word file from template Windows 11 Removing CustomUI when saving word file from template Office 2021
Expert
 
Join Date: Mar 2022
Posts: 552
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Quote:
Originally Posted by Guessed View Post
I have not yet seen a template with embedded customUI code produce new documents with contained customUI when the documents are created the RIGHT way (File>New or double clicking a dotm file). It is possible that this functionality has been broken on a recent update of Word 365 but I still haven't seen it.
For my testing I placed the template in my user templates folder and created the document using File>New.
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 12:39 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