Mail merge access 2003 - 2007

Hi experts

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
Wrd.ActiveDocument.MailMerge.DataSource.QueryString = varSQL
Wrd.ActiveDocument.SaveAs (Ud_fil)
Wrd.Application.Quit (False)

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DCRAPACCESSAuthor Commented:
Hi again

I have narrowed down the question, and found out that the attach picture was the problem.

I also found the solution :-)

by adding this:

to the following line:
Wrd.Application.Documents.Open fileName:=Tekstfil, ReadOnly:=True, NoEncodingDialog:=True

i got it to work :-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.