#1
|
|||
|
|||
Adding building block in bulk with *Formatting*
Hi!
I have been using a code (that, I believe, is from Greg Maxey?) which insert in bulk building blocks to a template that is later share with my co-workers. The titles and text for the building blocks are taken by the code in a table in a document. And when I write them in the table, I always make sure to use Normal style which is in Arial 12. The problem is when we use the building blocks, they are inserted with the "Normal Style" of the document. So if the document's Normal style is in Times but the document was created in Arial, the block is added in Times. All our documents are in Arial 12 and I want the building block to be also Arial 12. What should I change to make it possible? Here is a part of the code: Code:
For ia = 1 To cTable.Rows.Count Set aPrompt = cTable.Cell(ia, 1).Range aPrompt.End = aPrompt.End - 1 Set aTextPart = cTable.Cell(ia, 2).Range aTextPart.End = aTextPart.End - 1 Set objBB = oTmpB.BuildingBlockEntries.Add(Name:=aPrompt, _ Type:=wdTypeAutoText, Category:=sCategory, Range:=aTextPart) Next ia Souriane |
#2
|
||||
|
||||
Create a custom style (not repurposing a built-in style) which is Arial 12pt and make sure it is based on No Style. Apply this to your content before you store them as building blocks.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Sorry for not answering before. Didn't have time to work on this problem.
Seems a really good solution, makes a lot of sense. I applied it and tried it. So far it seems to works. Thank you very very much! I appreciate alot! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cannot save Building Block templates with project | grNadpa | Word VBA | 4 | 03-21-2022 07:18 AM |
VBA temperamentally not finding building block template | kateabode | Word VBA | 2 | 10-14-2018 08:35 PM |
VBA Word - Building Block (AutoText) - Array - Replace Text with Specific Building Blocks | jc491 | Word VBA | 7 | 01-03-2016 10:34 PM |
How to share building block macros? | rdross51 | Word VBA | 7 | 03-12-2015 08:59 AM |
Building blocks show correctly in dropdown, but wrong building block populates in doc | wordgirl123 | Word | 0 | 10-03-2013 08:30 AM |