Quote Originally Posted by sarveshspace View Post
I have copied the above code from some other post and have tweaked it a bit.
Yes, I know - I wrote the underlying code.

Put simply, replace:
    Set oTbl = Selection.Tables.Add(Range:=Selection.Range, NumRows:=2, NumColumns:=NumCols)Dim orng As Word.Range
    Set ornge = ActiveDocument.Range.Bookmarks("pretestpics").Range
    ActiveDocument.Bookmarks.Add "pretestpics", oTbl.Range
with:
    With ActiveDocument
      Set oTbl = .Tables.Add(Range:=.Bookmarks("pretestpics").Range, NumRows:=2, NumColumns:=NumCols)
    End With