That works, too, Peter.
>What I do is store the name of the document ("C:\My Documents\MyDoc.doc" in your case) if a field ( docname C 80) and use:
>.Documents.Open(mytable.docname)
>
>
>Peter
>
>
>
>
>>The short answer is "You don't". The long answer is......
>>
>>General fields are like the Roach Motel of VFP. They get in, but they don't get out. They are designed for embedded or linked OLE. Now, if you want to store documents in a table for future use by an external app through automation, look at changing the general field to a Memo(binary) field (a normal memo field with no code page trannslation). Then you can APPEND MEMO and COPY MEMO in and out of the database to a file and leverage your existing automation code.
>>
>>
>>>I have a table that has a general field called Docs for example. In this general field I have embedded a Word 97 document. Currently I have learned how to print a document using the following code:
>>>
>>>range = "999"
>>>from = "1"
>>>to = "999"
>>>oword = CreateObject("Word.Application")
>>>WITH oword
>>> .Documents.Open("C:\My Documents\MyDoc.doc")
>>> .ActiveDocument.PrintOut(0,0,range,"",from,to)
>>> .Quit
>>>ENDWITH
>>>
>>>My question is: How do I replace "C:\My Documents\MyDoc.doc" with the contents of my general field? I basically don't know how to reference the Word document that resides in my general field in order to print it.
>>>
>>>Thanks A Lot!
>>>Tom Welch
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05