Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VBA and VFP
Message
 
To
14/06/1999 16:49:37
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00228810
Message ID:
00229881
Views:
20
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
Previous
Reply
Map
View

Click here to load this message in the networking platform