Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Merge Question ABC Button..
Message
From
19/04/2008 17:46:54
Chris Sund
Silhouette Solutions
Utah, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Miscellaneous
Thread ID:
01311708
Message ID:
01311904
Views:
19
Hi Borislav,

Here's the chunk of code that actually does the merge...
oWord = Createobject("Word.Application")
		oWord.Visible = .T.



		oDoc = oWord.Documents.Open(Curdir()+"form_letters\"+pdocument)
		oDoc.MailMerge.MainDocumentType = 0
		oDoc.MailMerge.OpenDataSource(lcSourceDoc)

*!*			oDoc.MailMerge.Datasource.FirstRecord =  oDoc.MailMerge.Datasource.ActiveRecord
*!*			oDoc.MailMerge.Datasource.LastRecord = oDoc.MailMerge.Datasource.ActiveRecord


		oDoc.Activate && Make it the active foreground app
		oWord.ActiveDocument.ActiveWindow.View.ShowFieldCodes = .F.
I hope that helps.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform