Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-10-2022, 03:32 PM
grNadpa grNadpa is offline Tried to attach quick parts building block to my template but lost it altogether Windows 10 Tried to attach quick parts building block to my template but lost it altogether Office 2016
Advanced Beginner
Tried to attach quick parts building block to my template but lost it altogether
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default Tried to attach quick parts building block to my template but lost it altogether

How do I find where by building block template went?



When I tried to copy my Word 2016 template to my wife's PC, the QuickParts building block did not migrate.

So I went to my (word2016)>Insert>QuickParts>BuildingBlocksOrganiz er, scrolled to my building block (named "aPartialWaiver") and found that the "Save In:" was "Building Blocks.docx". Clicking the dropdown showed, in addition to Building Blocks.docx and normal.dotm, the name of my template (WaiverWorksheetV09.dotm)

So, after backing up my WaiverWorksheetV09.dotm, I went back and selected the WaiverWorksheetV09.dotm from the Building Blocks manager for my "aPartialWaiver" building block.

The WaiverWorksheetV09.dotm then obviously failed on
Code:
     "C:\Users\" & Environ("username") & "\AppData\Roaming\Microsoft\Document Building Blocks\1033\16\Building Blocks.dotx"
But replacing the statement with
Code:
     "C:\Users\" & Environ("username") & "\AppData\Roaming\Microsoft\Document Building Blocks\1033\16\WaiverWorksheetV09.dotm"
failed as well.
And now, my aPartialWaiver building block doesn't show up in the Building Blocks Manager at all. Gone.

And, of course, backing up my document before changing the Building Blocks turned out to be pointless.

Where can I find where the "aPartialWaiver" template went? (And how can I get all of the relevant Building Blocks to migrate to my wife's machine?)
Reply With Quote
  #2  
Old 11-11-2022, 07:40 AM
grNadpa grNadpa is offline Tried to attach quick parts building block to my template but lost it altogether Windows 10 Tried to attach quick parts building block to my template but lost it altogether Office 2016
Advanced Beginner
Tried to attach quick parts building block to my template but lost it altogether
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default

Quote:
Originally Posted by grNadpa View Post
How do I find where by building block template went?

And now, my aPartialWaiver building block doesn't show up in the Building Blocks Manager at all. Gone.
Where can I find where the "aPartialWaiver" template went?
Though I still do not know where the template went, I was able to use an earlier document to recreate the "aPartialWaiver" with all its bookmarks.

Quote:
(And how can I get all of the relevant Building Blocks to migrate to my wife's machine?)
I've inserted each of my custom Quick Parts into separate documents and saved them. My plan is to use those documents to manually insert Building Blocks on my wife's PC.

I'm going to leave this post unresolved for a few more days in case someone has a better idea to share.
Reply With Quote
  #3  
Old 11-11-2022, 09:14 AM
Italophile Italophile is online now Tried to attach quick parts building block to my template but lost it altogether Windows 11 Tried to attach quick parts building block to my template but lost it altogether Office 2021
Expert
 
Join Date: Mar 2022
Posts: 538
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Saving a building-block to a document template does not move the template to the building-blocks folder. The template will remain wherever you saved it.

Building Blocks Organizer will only show the templates that are currently loaded, so, unless you currently have open either "WaiverWorksheetV09.dotm" or a document created from it, your building block will not appear in the organizer.

If you are using code to insert the building-block then:
Code:
"C:\Users\" & Environ("username") & "\AppData\Roaming\Microsoft\Document Building Blocks\1033\16\WaiverWorksheetV09.dotm"
would only work if that is the path that you saved the document template to, which you hopefully didn't.

To insert a building-block from the document template use code such as:
Code:
    Dim tmp As Template
    Set tmp = ActiveDocument.AttachedTemplate
    tmp.BuildingBlockEntries(1).Insert Selection.Range
Reply With Quote
  #4  
Old 11-11-2022, 03:37 PM
grNadpa grNadpa is offline Tried to attach quick parts building block to my template but lost it altogether Windows 10 Tried to attach quick parts building block to my template but lost it altogether Office 2016
Advanced Beginner
Tried to attach quick parts building block to my template but lost it altogether
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default

Thank you, @Italophile, for your thoughtful response.
Quote:
Originally Posted by Italophile View Post
If you are using code to insert the building-block then:
Code:
"C:\Users\" & Environ("username") & "\AppData\Roaming\Microsoft\Document Building Blocks\1033\16\WaiverWorksheetV09.dotm"
would only work if that is the path that you saved the document template to, which you hopefully didn't.
I didn't.
Quote:
To insert a building-block from the document template use code such as:
Code:
    Dim tmp As Template
    Set tmp = ActiveDocument.AttachedTemplate
    tmp.BuildingBlockEntries(1).Insert Selection.Range
Unfortunately, the above code failed on a "Run-time error '5914'
The requested member of the collection does not exist".
Thought to try ...BuildingBlockEntries(0)... . Same result.

Both TemplateProject(BuildingBlocks) and TemplateProject(Built-In Building Blocks)
do show up in my WaiverWorksheetV09.dotm project list.

In any case, I have the application running on my wife's PC. What I ultimately found is that, on my wife's machine, the folder in "C:\Users" is NOT Environ("username")
When I replace the Environ("username") with the the literal folder name, the path works correctly. (Didn't realize at first that the C:\Users folder was hidden)

But where my "aPartialWaiver" building block went remains a mystery.

Last edited by grNadpa; 11-11-2022 at 03:48 PM. Reason: Clarification
Reply With Quote
  #5  
Old 11-11-2022, 08:48 PM
Guessed's Avatar
Guessed Guessed is offline Tried to attach quick parts building block to my template but lost it altogether Windows 10 Tried to attach quick parts building block to my template but lost it altogether Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
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

ActiveDocument.AttachedTemplate will fail if the ActiveDocument IS a template.

If the code is sitting in the same template as the building block then you can use
ThisDocument which will work in both the template itself and when attached to activedocument.

In my experience, using the Organizer to change the Save In template doesn't work - despite looking like it should. You need to insert the building block into a document and then create it as a new building block in the correct template.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #6  
Old 11-12-2022, 07:58 AM
grNadpa grNadpa is offline Tried to attach quick parts building block to my template but lost it altogether Windows 10 Tried to attach quick parts building block to my template but lost it altogether Office 2016
Advanced Beginner
Tried to attach quick parts building block to my template but lost it altogether
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
ActiveDocument.AttachedTemplate will fail if the ActiveDocument IS a template.
That makes sense. I never considered that.

Quote:
If the code is sitting in the same template as the building block then you can use ThisDocument which will work in both the template itself and when attached to activedocument.
I thought I tried that. But I apparently failed to get the "aPartialWaiver" building block into my WaiverWorksheetV09.dotm template

Quote:
In my experience, using the Organizer to change the Save In template doesn't work - despite looking like it should. You need to insert the building block into a document and then create it as a new building block in the correct template.
That sounds like the right approach. But I don't think I have the literacy to understand your comment. Or maybe that's what I ended up doing: I created .docx pages from the QuickParts on my machine, email those pages to my wife, and add them to my wife's Word Building Blocks.

Obviously hard-coding is not a satisfying solution. But it does work. And the only future migration would be to a replacement PC. Which can be done the same way. As mentioned, not very satisfying.
Reply With Quote
Reply

Tags
building block problems, vba, word2016



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tried to attach quick parts building block to my template but lost it altogether Quick Tables disappear when emailed - quick parts / building blocks silawtz Word 5 11-03-2022 07:44 PM
How to build a custom building block template cos Word 1 12-13-2021 03:43 PM
Tried to attach quick parts building block to my template but lost it altogether Building Blocks / Quick Parts houseofturner Word 4 07-19-2016 07:24 AM
Tried to attach quick parts building block to my template but lost it altogether Word 2013: Building Blocks / Quick Parts - Form Question EGoetz Word VBA 2 12-05-2013 09:09 PM
Quick Parts entries in .docm template lost kjworduser Word 7 07-31-2013 02:19 PM

Other Forums: Access Forums

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