Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2021, 05:16 AM
zxmon21 zxmon21 is offline multiple templates referencing common reference, in a network environment Windows 10 multiple templates referencing common reference, in a network environment Office 2016
Novice
multiple templates referencing common reference, in a network environment
 
Join Date: Sep 2021
Posts: 3
zxmon21 is on a distinguished road
Default multiple templates referencing common reference, in a network environment

Hi,
I have a number of forms (macro-enabled Word-templates) that share a lot of code. In order to make maintaining the code easier, I have put the shared code into a .docm file, put that in a network folder.
I add a reference to the .docm in the network location to each Word-template.



I encounter two problems with this setup:
- When I create a new instance of a document based on the template, the .docm file is loaded into a separate window. That's distracting.
- When multiple users have documents open that contain the shared reference, they get messages "xxx.docm is locked for editing by [user]". That's distracting.

I would like to share the code, but avoid the problems above. If the forms were in Excel, I'd put the shared code in an add-in (XLAM), which doesn't show as a window, and quietly accepts that it's opening read-only. I haven't found the Word-equivalent of XLAMs.

How would you share code in this situation? How would you prevent the above problems?
Reply With Quote
  #2  
Old 09-16-2021, 05:33 AM
zxmon21 zxmon21 is offline multiple templates referencing common reference, in a network environment Windows 10 multiple templates referencing common reference, in a network environment Office 2016
Novice
multiple templates referencing common reference, in a network environment
 
Join Date: Sep 2021
Posts: 3
zxmon21 is on a distinguished road
Default

Hm... Maybe I was a little too quick to write my own question... Reading a little more in this forum, I was inspired to try something.

For others encountering this problem:
Save the shared code in a .dotm file, not a .docm file

Advantages: The problems above disappear
Disadvantage: Development becomes a pain in the ... arm, as you can't see the code in the reference when testing a form instance. My workaround will be to use .docm during development, then change to .dotm when rolling out to users.
Reply With Quote
  #3  
Old 09-16-2021, 06:34 AM
Guessed's Avatar
Guessed Guessed is offline multiple templates referencing common reference, in a network environment Windows 10 multiple templates referencing common reference, in a network environment Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
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

With a dotm loaded as an addin you can run the code but if you want to do development on the same file you need to OPEN it directly (as well). That way you can edit the code and save the template as required.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
microsoft word, reference, vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple templates with common styles mikejvir Word 2 12-16-2019 09:44 PM
Excel Structured Referencing: non-English reference? tinfanide Excel 0 09-05-2015 04:41 AM
Share Excel Add-In In A Network Environment? ibrahimaa Excel 5 04-30-2012 05:30 AM
multiple templates referencing common reference, in a network environment Need help with sorting a column by most common to least common mikenmike0001 Excel 5 12-06-2011 05:17 PM
multiple templates referencing common reference, in a network environment link common slides in multiple presentations robtho PowerPoint 1 06-24-2011 12:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:53 PM.


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