Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting a fields from one record into Word
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00449272
Message ID:
00449610
Views:
16
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform