keepingbusy
Programmer
Hi
I have been searching this forum and Google to try and create a piece of code that will create a Microsoft Word Document (Version 2003 or 2007 if it will make a difference) and found the following which creates the document but does not populate it from a test table with three fields - forename, surname and add01:
Code:
oWord = CREATEOBJECT("Word.Application")
oWord.Visible = .F.
oDoc = oWord.Documents.Add()
LOCAL lcList
lcList=''
* To generate string(line) of the list
DO WHILE !EOF('EMP_LIST')
lcList= lcList+;
PADR(ALLT(EMP_LIST.FORENAME)+' '+;
ALLT(EMP_LIST.SURNAME),20,' ')+;
' - '+EMP_LIST.ADD01+;
CHR(13)
SKIP IN EMP_LIST
ENDDO
oWord.Quit(.T.) && save changes
RELEASE oWord
Any suggestions please guys? I am using VFP9.
Thank you
Lee