Using Access 2007, the following codes produces the following error:
.
Code:
Dim objWord As Object
Set objWord = GetObject("", "word.application")
objWord.Documents.Add
objWord.Visible = True
objWord.ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:=2, _
DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed
.
Error:
Run-time error '424'
Object required
.
Note:
it's the objWord.ActiveDocument.Tables.Add statement that's causing the error.
.
Code:
Dim objWord As Object
Set objWord = GetObject("", "word.application")
objWord.Documents.Add
objWord.Visible = True
objWord.ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:=2, _
DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed
.
Error:
Run-time error '424'
Object required
.
Note:
it's the objWord.ActiveDocument.Tables.Add statement that's causing the error.