PDA

View Full Version : Building Blocks only partially appearing in Word using VBA code



aussie_VA
01-25-2013, 11:11 AM
Using a WORD user form with multiple checkboxes which is checked will insert building block at a specific bookmark. Works great EXCEPT only the first few lines of the building block appear and then it cuts off. Any ideas why this happening as I can't seem to find a fix. :dunno
This is the code:
Dim T1 As String
If CheckBox1.Value = True Then
Selection.GoTo What:=wdGoToBookmark, Name:="bk1"
ActiveDocument.Bookmarks("bk1").Delete
Selection.InsertAfter ActiveDocument.AttachedTemplate.BuildingBlockEntries("T1")
ElseIf CheckBox1.Value = False Then
Selection.GoTo What:=wdGoToBookmark, Name:="bk1"
Selection.Delete Unit:=wdCharacter, Count:=1
ActiveDocument.Bookmarks("bk1").Delete
End If