Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting a fields from one record into Word
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00449272
Message ID:
00449610
Vues:
20
Try this as the first four lines:
<b>oWord</b>=CREATEOBJECT('word.document')
<b>oDocument = oWord</b>.documents.OPEN('c:\qcf19.doc')
<b>oWord</b>.VISIBLE=.T.

oRange = <b>o</b>Document.selection.range()
The bolding indicates changed items. Mostly, I've renamed the object variables to clarify what object is reference, though I did add an oDocument object so you can track the document separately.

Hope this helps.

- della

>Della, thanks for taking the time to respond. I've hacked at it for awhile now and have this:
>
>
ox=CREATEOBJECT('word.document')
>ox.APPLICATION.documents.OPEN('c:\qcf19.doc')
>ox.APPLICATION.VISIBLE=.T.
>
>oRange=Document.selection.range()  &&IT CHOKES HERE
>
>#DEFINE wdLine 5
>
>with oRange
>.MoveDown(wdLine,1)
>.TypeParagraph
>.TypeParagraph
>.MoveUp(wdLine,2)
>.InsertDateTime("MMMM d, yyyy",.f.)
>.TypeParagraph
>.Typeparagraph
>.TypeText (&l_address)
>endwith
>
>As a result of my misunderstanding of the Range object definition, nothing else works properly.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform