Discussion Locked

Visual Foxpro (Microsoft word integratio

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am doing a command button to allow to open an specific word document, Select all document, copy on the clipboard, close microsoft Word and paste the document in my application to a memo field.

How I can do it?

5 replies

by jeff

oWord = createobject("word.application")
oWord.Documents.Open("c:\yourfile.doc")
oword.Selection.WholeStory
oword.Selection.Copy
a=_cliptext
oword.quit
release oword

a is now ready to go into you memo field

HTH
Jeff

by estebandelatorre

Create an instance of Word
oWord = createobject("word.application")
Open your file
oWord.Documents.Open("c:\yourfile.doc")
Select the whole contents
oword.Selection.WholeStory
Copy it to the clipboard
oword.Selection.Copy
Save it in a variable
a=_cliptext
Close Word
oword.quit
Release Object
release oword

Now you have the a variable with the whole contents of the doc. file, Formatting will be lost!!

This discussion is closed to new replies.