>All,
>
>I'm trying some office automation using word 2000 and VFP7. Been following the book "Office Automation with Visual Foxpro" but not having much luck.
>(I have had success working with Excel and Access). 'oWord = CreateObject("Word.Application")' works ok as does 'oDocument = oWord.document.open("name of document")' and certainly 'oWord.Application.Visable = .T.'. I have the document displayed in word. oDocument is created as an object called oDocument with no properties/methods - just the object. And that's as far as it goes. oDocument returns nothing but ole errors. Even the simplest ? "oDocument.Name" gives an ole error - "OLE error code 0x800a8029 Unknown COM status code."
>
>What might be going on?? I would blame it on my install of WIN2000/Office2000 except I have another machine with Word 97/Win2000 and it does the same thing. Anybody got some suggestions as to what I may be doing wrong??
>
>Steve
? "oDocument.Name"
Is this really the code you're trying or a typo ?
This little sample works wonderfully well for me :
Local oWord as "Word.Application", lcDoc as String, oDoc as "Word.Document"
lcDoc = GetFile('doc')
oWord = CREATEOBJECT("Word.Application")
oDoc = oWord.documents.open(lcDoc)
? oDoc.Name
oWord.visible= .T.
Cetin