Juan,
I copied and pasted that code into both the VFP5a and VFP6 command window, highlihted it, rightclicked and selected Execute Selection. It ran fine both times.
I've not yet installed the VS98 SP1, nothing I'm actively working on requires it, so I'm waiting till I get the MSDN CD instead of doing a multigigabyte download from the net. If you go to the MS site you can get the VS98 SP1. I'm also Win95 OSR2 instead of NT.
>Reinstalled Office 97 and re-applied SM1. Applied SP4 to my NT 4.0 OS.
>
>Tried the 5 lines of code you specified:
>
>oWord = createobject( "word.application" )
>oWord.Visible = .t.
>oDoc = oWord.Documents.Add()
>oDoc.PageSetup.LineNumbering.Active = .f.
>oWord.Selection.InsertAfter( "Test" )
>
>Same error occured! I tried the same code in VFP5 and it worked beautifully!
>
>You had previously mentioned that this code ran perfectly in your copy of VFP6.
>
>I understand that MS was coming out with a service pack for Visual Studio 6. Do you know if that SP is out yet? If so, have you applied it?