Consultor Eletrônico



Kbase P164161: How can I read the the contents of a Word document as text?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   19/04/2010
Status: Unverified

GOAL:

How can I read the the contents of a Word document as text?

GOAL:

How can I obtain the content of a Word document?

FACT(s) (Environment):

Windows
Progress 9.x
OpenEdge 10.x

FIX:

The contents of a Word document can be read into a character variable as text (limited to approximately 32K) by using the following code:

DEFINE VARIABLE vData AS CHARACTER NO-UNDO.
DEFINE VARIABLE hWord AS COM-HANDLE NO-UNDO.

/* Code to load MS Word and Open the document goes here */

/* The following code grabs the text of the current (active) document and puts it into a character variable */

vData = hWord:ActiveDocument:Content:Text.