Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need help with word automation syntax
Message
De
23/05/2001 09:41:44
 
 
À
22/05/2001 23:59:41
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00510195
Message ID:
00510315
Vues:
12
If you are going to be doing a lot of Office Automation, I would suggest getting the book Microsoft Office Automation with Visual FoxPro by Tamar Granor and Della Martin. You can get more details about this and other fantastic VFP books at http://www.hentzenwerke.com.

>I am a newbie to doing word automation. I am having trouble with the syntax for executing some of the methods. I have seen the documentation on MSDN (as discussed in other threads)
>
>This is what I want to accomplish:
>
>
>1) I have a 'base' word document. It has mostly fixed text, but some variable text. Most of the variable text is in tables. Some is embedded within a paragraph.
>
>2) I want to copy the base document to another temp document and then open the temp document with word automation.
>
>3) I want to write changes to the variable text and save the temp document.
>
>4) I want to print the temp document via word automation.
>
>I am good with steps 1,2 and 4.
>
>How can I access and write to individual cells in the table. How can I change other variable text that is not in a table.
>
>The online documentation on MSDN gives an example of making a document the active document:
>
>Documents("MyDocument.doc").Activate
>What is the VFP equivalent for this?
>
>I already have:
>
>oWord=CREATEobject("Word.Application")
>lcfilename='execsum\'+'execsummain3.doc'
>oWord.Visible= .t.
>oDoc=oWord.Documents.Open(lcfilename)
>** the above works
>** next i want to activate the document, and write changes to a table cell
>
>** the code below doesnt' work
>odoc.activate("execsummain3.doc") && error ole error code 80020011 - does not *support a collection
>
>wait wind odoc.activedoc.tables(1).cell('Row:=1', 'Column:=1')
>** get activedoc is not an object (or similar)
>
>**what should the syntax be for activating the document, writing changes to the
>** table
>***********************
>
>**this works
>odoc.close()
> oword.quit(0)
>
>TIA
Thanks,
Dan Jurden
djurden@outlook.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform