View Single Post
 
Old 02-11-2016, 04:51 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Why are you trying to use column?

Code:
Private Sub ComboBox1_Change()
Dim lngIndex As Long
Dim objTemplate As Template
Dim oBuildingBlock As BuildingBlock
  Set objTemplate = Templates(Environ("APPDATA") & "\Microsoft\Word\STARTUP\ReportMacros.dotm")
  ComboBox2.Clear
  For lngIndex = 1 To objTemplate.BuildingBlockEntries.Count
    Set oBuildingBlock = objTemplate.BuildingBlockEntries.Item(lngIndex)
    If oBuildingBlock.Type.Name = "AutoText" And oBuildingBlock.Category.Name = ComboBox1 Then
      With ComboBox2
        .AddItem
        .List(.ListCount - 1, 0) = oBuildingBlock.Name
        .List(.ListCount - 1, 1) = oBuildingBlock.Value
      End With
    End If
  Next lngIndex
  ComboBox2.Text = ComboBox2.List(0)
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote