View Single Post
 
Old 02-13-2020, 07:12 AM
Dont know Dont know is offline Windows 10 Office 2016
Novice
 
Join Date: Feb 2020
Posts: 5
Dont know is on a distinguished road
Default

Thanks for your reply, i changed the code to below, but get a run error 5941 now any ideas?


Sub TestCGBT()
Dim oTbl As Table
' TestCGBT Macro


Application.Templates("P:\Templates\CG Research Template.dotm"). _
BuildingBlockEntries("CG body text table").Insert Where:=Selection.Range, _
RichText:=True

Set oTbl = Selection.Tables(1)
oTbl.Cell(1, 1).Range.Select

Selection.SplitTable
Application.Templates("P:\Templates\CG Research Template.dotm"). _
BuildingBlockEntries("Figure 1: Title").Insert Where:=Selection.Range, _
RichText:=True
Selection.Delete Unit:=wdCharacter, Count:=1
Dialogs(wdDialogTableInsertTable).Show

End Sub
Reply With Quote