![]() |
|
#1
|
|||
|
|||
![]() Quote:
I'll look into that, but I don't understand why this has worked for me with multiple documents before? This seems like it will complicate things a bit, if I now have to provide 2 documents for our users to install, and make sure that both are in place, if I understand what you are suggesting. And I will need to get the proper file path to the correct file in the global template, since I can't just reference the template containing the content itself. |
#2
|
|||
|
|||
![]() Quote:
They are creating documents to go to someone else using your Custom UI? If in code, you refer to ThisDocument instead of ActiveDocument it gives reference to the file holding the code. Global templates go in the Word Startup Folder. I can give you code to identify this folder if you need it. ? Application.StartupPath in the Immediate Window identifies it. Here is a macro Code:
Sub ShowStartUpPath() ' Macro written by Charles Kenyon 2014-02-25 ' Shows setting for Startup Folder location in Microsoft Word in a message box. ' MsgBox _ Prompt:="Your StartUp folder location is " & _ Application.StartupPath & _ "." & Chr(13) & Chr(10) & Chr(13) & Chr(10) & ".", _ Buttons:=vbOKOnly, _ Title:="Current Startup Folder Setting Information" ' End Sub |
#3
|
||||
|
||||
![]() Quote:
Quote:
Quote:
Perhaps I misunderstood what you meant by 'global template'. I was reading that as a separate template file with the UI and VBA code, and a separate template file with the content with no UI and VBA code. Currently, the template file has the content and the UI and VBA. It is stored in the 'Startup Folder' as mentioned in my original posting. Quote:
|
#4
|
|||
|
|||
![]() Quote:
A global template that contains the UI modifications and any related code, separate from the document template that contains the content and document format/styles. The global could also hold building blocks that can be used to create content. I am assuming that your UI modification is done by editing the XML of the template, not through vba on-the-fly editing. (Customize the Office Ribbon (It doesn't take rocket science) by Greg Maxey ) A global template in the Startup folder shares the UI modifications with all other documents / templates but does not insert those mods in others. They can be used. If this is only to work with certain document templates, those templates could load the Add-In upon creation of a document and then the document template's code could unload the Add-In when the new document is closed. |
#5
|
|||
|
|||
![]() Quote:
Ok, so what you're saying is if i have 5 different document templates, I create the templates without code or the CustomUI, and another template with all of the code and CustomUI for all 5 documents? Currently, i am using the 'Document_New()' event of the template (in the 'ThisDocument' Microsoft Word Objects space) to run the code to set up the document (shows a userform to collect data, and populates the document). To move the code to a 'Master' template, I'd need to move this activation to an app event handler "App_NewDocument(ByVal Doc As Document)" event in the Master template, then I'd need to determine which template created the active document, and run the setup function(s) needed for that specific template? Is this the proper workflow? Edit: after thinking about this, i might be able to keep all of the code for the setup of the document in the content template, and move the rest of the UI specific code to a separate 'Master' since that's mostly for editing/updating the document once it's created. Theres's a 'New XXXX Document' button to create a new document from the specific template, but that would just need to create the document, and the rest of the code would work as usual. I very much appreciate your assistance, and patience, with me. |
#6
|
|||
|
|||
![]() Quote:
You are the homeowner coming to the carpenter saying "I've used this hammer to drive screws for the last ten years but it isn't working now." I do not know why it worked for you in the past and is not working now. I know you are using the wrong tool for the job. |
![]() |
|
![]() |
||||
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 |
![]() |
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 |