Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to automate Word from Foxpro
Message
From
20/09/2002 21:17:25
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00702938
Message ID:
00702989
Views:
13
Try Selecting the Field first. InsertAfter and InsertBefore work on a range or selection object.
Also, your note says that you want to replace the field with your text, so maybe you should be saving the value to _cliptext and then using 'paste' on the selection.

Alan

>I forgot to include my existing code that doesn't quite work:
>
>oWord = CREATEOBJECT('Word.Application')
>m_first="Mr. Smith"
>oWord.documents.open("c:\letter1.dot")
>oWord.activedocument.content.insertafter(m_first)
>oWord.visible = .t.
>
>In the Word Template, I create a field called "m_first". I think perhaps I did not create this right.
>
>Thanks,
>
>N.
>
>>From within VFP 7.0 I am able to instance of Word. However what I would like to do is open a Word template and perhaps replace three fields with three values from Foxpro. The user would then change the letter as necessary and then save or print it from Word. Is this possible?
>>
>>Thanks,
>>
>>Nancy.
Previous
Reply
Map
View

Click here to load this message in the networking platform