
Originally Posted by
gmaxey
Sarah,
When you start Word on one of these remote laptops, is the BuildingBlocks.dotm loaded? If isn't then you IT people aren't placing it in the user's startup folder. If it is, then you need to set a template object variable to it. E.g.,
Dim m_oTmp as Template
If m_oTmp Is Nothing Then
For Each m_oTmp In Templates
If UCase(m_oTmp.Name) = "BUILDINGBLOCKS.DOTM" Then Exit For
Next m_oTmp
End If
Now you should be able to use m_oTmp in your code to insert various BBs.
Hi Greg
No my IT people had put the file in the Templates folder, the same as where the Normal.dotm file is because originally that is where building blocks were pulled from. However, following your original reply I put a copy of the building blocks template in my start up folder on my remote desktop to test your solution and it still didn't work.
I have now tried the above code but it just throws an exception (my userform doesn't even load). However I may be putting it in the wrong place (I put it at the top of my userform code as it is my userform code which is trying to pull the building blocks). I don't really understand what that piece of code does. My original code for the user form sets the template as the template path I've been trying to use:
Set oTmp = Templates("C:\Users\xx\AppData\Roaming\Microsoft\Word\STARTUP\Building Blocks.dotm")
Does this not already set the object variable for the template?
Sorry, I've literally had to learn all of this on the fly for this project, so I'm probably not understanding the nuances of the various ways of coding.
SJ