At work we are going to change from office 2003 to 2007. We have mdb database and in one of the reports we use mail merge:
Wrd.Application.Documents.Open fileName:=Tekstfil, ReadOnly:=True
varSQL = "SELECT TEKST.POR, TEKST.PER_TWR, TEKST.PER_BENCH, TEKST.AAR_TWR, TEKST.AAR_BENCH FROM SASADMIN.TMSRAP_TEKST_DAOB TEKST WHERE TEKST.BNR = 'BATCH' AND TEKST.POR='" & PM & "'"
Wrd.ActiveDocument.MailMerge.DataSource.QueryString = varSQL
When we use a 2003 version of access it copies a word file to "c:\temp\" and then get the text from that file. If i open the word file it has got the right values from the database. But in access 2007 it can't get the values?
The access database is a mdb file and the word document is a doc file.
I think the error is in the code above, because that is where is copies the word doc and sets the DataSource.