Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
sos sos is offline
external usenet poster
 
Posts: 4
Default Printing Building Blocks Auto Text List - Microsoft 2007

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?
  #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



  #3   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

This will produce a formatted document containing the list of
BuildingBlocks.
Option Explicit
Dim bbArray()
Dim oTmp As Template
Dim i As Long
Dim j As Long
Sub BuildList()
Dim lngCount As Long
Dim BBC As Category
Dim BBT As BuildingBlockType
lngCount = 0
For Each oTmp In Templates
For i = 1 To oTmp.BuildingBlockEntries.Count
lngCount = lngCount + 1
Next
Next
If lngCount 0 Then
ReDim bbArray(0 To lngCount - 1, 1 To 5)
Else
ReDim bbArray(0)
End If
j = 0
For Each oTmp In Templates
For i = 1 To oTmp.BuildingBlockEntries.Count
Set BBT = oTmp.BuildingBlockEntries(i).Type
Set BBC = oTmp.BuildingBlockEntries(i).Category
bbArray(j, 1) = oTmp.BuildingBlockEntries(i).Name
bbArray(j, 2) = oTmp.Name
bbArray(j, 3) = oTmp.BuildingBlockEntries(i).Value
bbArray(j, 4) = BBT.Name
bbArray(j, 5) = BBC.Name
j = j + 1
Next
Next
CreateList
Set BBT = Nothing
Set BBC = Nothing
StatusBar = "List complete"
System.Cursor = wdCursorNormal
End Sub
Sub CreateList()
Dim oDoc As Word.Document
Dim oRng As Word.Range
Dim pStr As String
Dim oTbl As Word.Table
Set oDoc = Documents.Add
System.Cursor = wdCursorWait
With oDoc.PageSetup
.Orientation = wdOrientLandscape
.LeftMargin = 36
.RightMargin = 36
End With
Set oRng = oDoc.Range
Set oTbl = oDoc.Tables.Add(oRng, UBound(bbArray) + 3, 5)
StatusBar = "Creating list. Please wait"
Application.ScreenUpdating = False
With oTbl
.Columns(1).Width = 100
.Columns(2).Width = 100
.Columns(3).Width = 300
.Columns(4).Width = 110
.Columns(5).Width = 110
.Rows(1).Cells.Merge
.Cell(1, 1).Range.Text = "BuildingBlocks"
For i = 1 To 5
.Cell(2, i).Range.Text = Choose(i, "Name", "Template", "Value",
"Gallery", "Category")
Next
For i = 0 To UBound(bbArray)
For j = 1 To 5
.Cell(i + 3, j).Range.Text = bbArray(i, j)
Next j
Next i
.Rows(1).Shading.BackgroundPatternColor = wdColorGray25
.Rows(1).Cells(1).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Rows(2).Shading.BackgroundPatternColor = wdColorGray10
.Rows.AllowBreakAcrossPages = False
For i = -6 To -1
With .Borders(i)
.LineStyle = Options.DefaultBorderLineStyle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
End With
Next i
If MsgBox("Do you want to sort the list by building block name?", _
vbQuestion + vbYesNo, "Sort List") = vbYes Then
.Rows(1).ConvertToText
.Sort ExcludeHeader:=True, FieldNumber:="Column 1", SortFieldType _
:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending
End If
End With
Application.ScreenUpdating = True
Beep
End Sub


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



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Rebekah Rebekah is offline
external usenet poster
 
Posts: 10
Default Printing Building Blocks Auto Text List - Microsoft 2007

Hi Greg

I tried copying/pasting the two macros you suggested, but I had errors with
them. I'm unfamiliar with VB - I simply pressed Macro, named it and pressed
Create, pasted the macro text, then closed out of the Visual Basic screen.
Is this correct?

The error I got with the "List Quick Parts" macro was: "Compile Error -
Expected End Sub". The error showing for "Print Quick Parts" was: "Compile
Error - Invalid Inside Procedure"

Could you explain how to fix the problem, as I'd like to list all the Quick
Parts I've been creating to distribute to other staff.

Thanks very much
Rebekah

"Greg Maxey" wrote:

This will produce a formatted document containing the list of
BuildingBlocks.
Option Explicit
Dim bbArray()
Dim oTmp As Template
Dim i As Long
Dim j As Long
Sub BuildList()
Dim lngCount As Long
Dim BBC As Category
Dim BBT As BuildingBlockType
lngCount = 0
For Each oTmp In Templates
For i = 1 To oTmp.BuildingBlockEntries.Count
lngCount = lngCount + 1
Next
Next
If lngCount 0 Then
ReDim bbArray(0 To lngCount - 1, 1 To 5)
Else
ReDim bbArray(0)
End If
j = 0
For Each oTmp In Templates
For i = 1 To oTmp.BuildingBlockEntries.Count
Set BBT = oTmp.BuildingBlockEntries(i).Type
Set BBC = oTmp.BuildingBlockEntries(i).Category
bbArray(j, 1) = oTmp.BuildingBlockEntries(i).Name
bbArray(j, 2) = oTmp.Name
bbArray(j, 3) = oTmp.BuildingBlockEntries(i).Value
bbArray(j, 4) = BBT.Name
bbArray(j, 5) = BBC.Name
j = j + 1
Next
Next
CreateList
Set BBT = Nothing
Set BBC = Nothing
StatusBar = "List complete"
System.Cursor = wdCursorNormal
End Sub
Sub CreateList()
Dim oDoc As Word.Document
Dim oRng As Word.Range
Dim pStr As String
Dim oTbl As Word.Table
Set oDoc = Documents.Add
System.Cursor = wdCursorWait
With oDoc.PageSetup
.Orientation = wdOrientLandscape
.LeftMargin = 36
.RightMargin = 36
End With
Set oRng = oDoc.Range
Set oTbl = oDoc.Tables.Add(oRng, UBound(bbArray) + 3, 5)
StatusBar = "Creating list. Please wait"
Application.ScreenUpdating = False
With oTbl
.Columns(1).Width = 100
.Columns(2).Width = 100
.Columns(3).Width = 300
.Columns(4).Width = 110
.Columns(5).Width = 110
.Rows(1).Cells.Merge
.Cell(1, 1).Range.Text = "BuildingBlocks"
For i = 1 To 5
.Cell(2, i).Range.Text = Choose(i, "Name", "Template", "Value",
"Gallery", "Category")
Next
For i = 0 To UBound(bbArray)
For j = 1 To 5
.Cell(i + 3, j).Range.Text = bbArray(i, j)
Next j
Next i
.Rows(1).Shading.BackgroundPatternColor = wdColorGray25
.Rows(1).Cells(1).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Rows(2).Shading.BackgroundPatternColor = wdColorGray10
.Rows.AllowBreakAcrossPages = False
For i = -6 To -1
With .Borders(i)
.LineStyle = Options.DefaultBorderLineStyle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
End With
Next i
If MsgBox("Do you want to sort the list by building block name?", _
vbQuestion + vbYesNo, "Sort List") = vbYes Then
.Rows(1).ConvertToText
.Sort ExcludeHeader:=True, FieldNumber:="Column 1", SortFieldType _
:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending
End If
End With
Application.ScreenUpdating = True
Beep
End Sub


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




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing Building Blocks Daniella1848 Microsoft Word Help 2 August 21st 08 08:52 PM
Word 2007 Building Blocks can you list them alphabetically? Tazz1 Microsoft Word Help 1 May 21st 08 03:17 PM
print list of autotexts/building blocks in Word 2007 susann Microsoft Word Help 6 April 29th 08 12:50 AM
Autotext (Building Blocks?) - 2007 Sue C Microsoft Word Help 8 June 15th 07 10:36 AM
Automating document building using building blocks and content con Big Dave Microsoft Word Help 1 June 12th 07 07:01 PM


All times are GMT +1. The time now is 09:17 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"