Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VBA and VFP
Message
 
À
14/06/1999 16:49:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00228810
Message ID:
00229881
Vues:
23
Hi Paige

I thought you might be interested in the following code. It does a search an replace from VFP with Word97 using VBA. It works very well. This example is searching for tags of the form <> and replacing them with the actual name of a person contained in the array MName. This was for custom labels with 6 labels per page.


oWordObj.Documents.Open(Sys(5)+Sys(2003)+"\Doc\NameTags.Doc")
oWordObj.ActiveDocument.Select()
oFindObj=oWordObj.Selection.Find
oFindObj.Execute("<>",,,,,,,,,MName(1),2)
oFindObj.Execute("<>",,,,,,,,,MName(2),2)
oFindObj.Execute("<>",,,,,,,,,MName(3),2)
oFindObj.Execute("<>",,,,,,,,,MName(4),2)
oFindObj.Execute("<>",,,,,,,,,MName(5),2)
oFindObj.Execute("<>",,,,,,,,,MName(6),2)
oWordObj.ActiveDocument.PrintOut()
oWordObj.ActiveDocument.Close(0)

Simon
Simon White
dCipher Computing
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform