View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default Printing Building Blocks Auto Text List - Microsoft 2007

To answer your specific question you can create a list of building block
names and their values using a macro. Note ** representes a non text value:

Sub ListAllBuildingBlocks()
Dim oTmp As Template
Dim oBBT As BuildingBlockType
Dim oCat As Category
Dim oRng As Word.Range
Dim oBB As BuildingBlock
Dim h As Long
Dim i As Long
Dim j As Long
Dim k As Long
Set oRng = ActiveDocument.Range
For h = 1 To Templates.Count
Set oTmp = Templates(h)
For i = 1 To oTmp.BuildingBlockTypes.Count
Set oBBT = oTmp.BuildingBlockTypes(i)
If oBBT.Categories.Count 0 Then
'Categories can exist that don't have any BBEs
If ValidateCategories(oBBT) = True Then
oRng.InsertAfter oTmp.Name & "/" & "Building Block Type: " &
oBBT.Name + vbCr
oRng.Paragraphs.Last.Previous.Format.Shading. _
BackgroundPatternColor = wdColorGray25
For j = 1 To oBBT.Categories.Count
Set oCat = oBBT.Categories(j)
If oCat.BuildingBlocks.Count 0 Then
oRng.InsertAfter "Buidling Block Category: " & oCat.Name + vbCr
oRng.Paragraphs.Last.Previous.Format.Shading. _
BackgroundPatternColor = wdColorGray10
For k = 1 To oCat.BuildingBlocks.Count
oRng.InsertAfter oBBT.Categories(j).BuildingBlocks(k).Name +
vbTab + oBBT.Categories(j).BuildingBlocks(k).Value + vbCr

Next
End If
Next
End If
End If
Next
Next
End Sub
Function ValidateCategories(ByRef BBT As BuildingBlockType) As Boolean
Dim i As Long
For i = 1 To BBT.Categories.Count
If BBT.Categories(i).BuildingBlocks.Count 0 Then
ValidateCategories = True
Exit Function
End If
Next
End Function

For some additional information on building blocks and tools for enhancing
thier use see:

http://gregmaxey.mvps.org/Word2007_B...&_AutoText.htm

SOS wrote:
I figured out how to use auto text and use it frequently. However, I
have added so many words and phrases that I am beginning to loose
track of what is in there. I need to print out a list of what I have
already put in so that I can see what still needs to be added.
Looking at the list is not enough because the preview is too tiny to
decipher. How do I print a list of all the shortcuts and the
word/phrases that will pop in when I hit F3?


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org