Your 'oDocument' variable refers to a workbook while the 'selection' refers to application and not to workbook.
In other words,
you can do:
With oDocument.Worksheets(1).Range("a1:g1").Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
and not:
oDocument.Worksheets(1).Range("a1:g1").select
because in this case you don't have the variable to refer to application because you would write:
With <variable for application>.Selection.Borders(xlEdgeLeft)
...
End With
I hope it can help.
Regards,
Antonio
Bookmarks