Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Merge Question ABC Button..
Message
 
À
19/04/2008 17:46:54
Chris Sund
Silhouette Solutions
Utah, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Divers
Thread ID:
01311708
Message ID:
01311928
Vues:
24
>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.
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.MailMerge.EditMainDocument
oDoc.MailMerge.Destination = 0           && File
oDoc.MailMerge..Execute(.t.)             && Merge to new file
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform