View Single Post
 
Old 01-11-2015, 02:46 PM
jjfreedman jjfreedman is offline Windows 7 64bit Office 2013
Advanced Beginner
 
Join Date: May 2012
Location: https://jay-freedman.info
Posts: 39
jjfreedman is on a distinguished road
Default

1. No, Microsoft has not provided any way to "edit" the contents of an existing building block, so your wish won't be granted. The only way to modify an existing building block is to insert it in some document, change the necessary parts, select the whole content, and add the building block again with the same name. When you do this manually with Alt+F3, Word pops up a message asking whether to replace the existing building block, but VBA just does the replacement. Then you need to save the template to make the change permanent.

2. Yes, an array of the Excel named ranges is an efficient way to handle looping to create a lot of similar building blocks. Going a step further, you could have the macro create the array by reading the list of named ranges from the workbook's Names collection http://excel.tips.net/T003106_Using_...n_a_Macro.html. (When you work with Excel VBA objects in Word or another program, you need to click the Tools menu in the macro editor, click References, and check the box next to Microsoft Excel Object Model. When you use objects that have the same name in both Word and Excel, such as Range, you must qualify the data type in the Dim declaration, for example Word.Range or Excel.Range.)

3. That isn't going to help. See point 1.
Reply With Quote