Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-21-2022, 12:43 PM
Souriane Souriane is offline Adding building block in bulk with *Formatting* Windows 10 Adding building block in bulk with *Formatting* Office 2019
Advanced Beginner
Adding building block in bulk with *Formatting*
 
Join Date: Feb 2017
Location: Quebec, Canada
Posts: 82
Souriane is on a distinguished road
Default 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
Thank you for your help!

Souriane
Reply With Quote
  #2  
Old 12-21-2022, 04:08 PM
Guessed's Avatar
Guessed Guessed is offline Adding building block in bulk with *Formatting* Windows 10 Adding building block in bulk with *Formatting* Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
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

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
Reply With Quote
  #3  
Old 01-24-2023, 07:20 AM
Souriane Souriane is offline Adding building block in bulk with *Formatting* Windows 10 Adding building block in bulk with *Formatting* Office 2019
Advanced Beginner
Adding building block in bulk with *Formatting*
 
Join Date: Feb 2017
Location: Quebec, Canada
Posts: 82
Souriane is on a distinguished road
Default

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!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding building block in bulk with *Formatting* Cannot save Building Block templates with project grNadpa Word VBA 4 03-21-2022 07:18 AM
Adding building block in bulk with *Formatting* 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
Adding building block in bulk with *Formatting* 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft