I am trying to use some code Iwrote for the stand alone version to work in AVFP. It is program to run mailmerges in MS Word. I would think it could work.
Here is some of the code:
#Define wdSendToNewDocument 0
#Define wdDefaultFirstRecord 1
#Define wdDefaultLastRecord -16
loWord = CREATEOBJECT("Word.Application")
lcDocument = "C:\mailmerge\test.doc"
cTempFile = "C:\mailmerge\MailMergeData.csv"
loWord.ActiveDocument.MailMerge.OpenDataSource( cTempfile, 0, .F.,,.t.,,,,,,, )
loWord.ActiveDocument.MailMerge.DataSource.FirstRecord = wdDefaultFirstRecord
loWord.ActiveDocument.MailMerge.DataSource.LastRecord = wdDefaultLastRecord
If I stop it before the Perform Merge part it does nothing where it should, at least, open the document.
Any chance this might work and, if so, what am I doing wrong?
Thanks for any help.