Hi!
Open the Wrd Basic in the Word (Macros menu) and get fro there to help on all objects and properties of the MS Word application. There are a lot of this, so following is a trick to quickly figure out things you want:
- Prepare a document to the state before you need to add additional functionality.
- Use oWord.Visible = .T. to show the MS Word (if it is not already shown).
- From menu start writing the macro.
- Do the actions you want to be saved in correct order. All will be written.
- Save the macro.
- Open the Word Basci editor and see the source code of the macro. You will see the Word Basic commands that are used to reproduce all actions programmatically. It is not a problem to convert them to VFP code, but you will require to get help for most methods to get correct parameters list for call from VFP.
HTH.
>I want to extract data from table like name, designation, company and add in a preformatted word document. I am able to open word and the file but I am looking for the syntax which will insert the required data on to the specific line.
>
>oWord = CreateObject("Word.Application") && Opens MSWord Application
>oWord.Visible=.t.
>oWord.Documents.Open('DocumentName.doc') && Opens the Document
>oWord.ActiveDocument.MailMerge.OpenDataSource('datapath') && Sets the DataSource
>
>Please help and if possible send cc mail to aslam@gih-ku.com
>
>I am sure I will get enough responses and therefore I thank you in advance.
>
>Regards,
>Aslam
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.