Hi all, I'm using VBScript to create a Word doc from a web page. Everything
was going fine until I tried to add a table to the doc, then I get an error
which I can't account for. This is my code:
function test
dim oWord dim oDoc
set oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Documents.Add
set oDoc = oWord.ActiveDocument
oDoc.PageSetup.Orientation = 1
oDoc.Tables.Add Range:=oWord.Selection.Range, NumRows:=2,
NumColumns:=3
oWord.Selection.TypeText "Ben was here"
set oWord = nothing
end function
This runs fine if I comment out the oDoc.Tables.Add line. I have tried
approaching the tables call from all directions, eg.
oWord.ActiveDocument.Tables.Add, as well as the Range call, with no luck.
I'm running IE6 and Office XP.
Any help would be greatly appreciated :o)
Regards, Ben Empson
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/