View Single Post
 
Old 11-11-2022, 03:37 PM
grNadpa grNadpa is offline Windows 10 Office 2016
Advanced Beginner
 
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