Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving Content of MS Word document
Message
De
15/01/1999 10:56:51
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
15/01/1999 05:01:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00176363
Message ID:
00176502
Vues:
26
>Hi,
> I would like to get the content of word document from MS Word, to process the text into some form by used for speech. Is there any way to do so?? I know that we need to createobject of word.application. That, what the following command and statement ???
>Thank you


Hi John,

Here's a bit of code that can be used to get the complete text of a document from Word 97

LOCAL loWord

loWord = CREATEOBJECT("Word.Application")
loWord..documents.open("c:\test.doc")
loWord.documents("test.doc").select
lcText = loWord.selection.text

and now lcText contains the text of the document.

There are probably better ways to process the document, rather than just grabbing all of the text, you could iterate through each section of the document, using the appropriate collections.

To get info on the Word 97 object model, start the office 97 setup, go to the Word section, then the Help section, and install the Microsoft Word Visual Basic Reference. This help file will now be available from the main MS Word help contents.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform