Window printer dialog box

Hi,

I have created a program to open a mailmerge template, and will use VB to control the merging of document.

I have initially work with this using WinXP, but realize that it wouldn't work for those in Win2000 environment. Therefore I have recompiled the project in a Win2k environment, reference object change from Microsoft Word 10.0 Object library to Microsoft Word 9.0 object library.

The compilation is fine, but I meet with a little problem. In my code I have this line:
   With objDoc.MailMerge
       If .State = wdMainAndDataSource Then
           .Destination = wdSendToPrinter
           
           .SuppressBlankLines = True
           
           'get the record count of the datasource
           With .DataSource
             .ActiveRecord = wdLastRecord
             x = .ActiveRecord
             'set the activerecord back to the first
             .ActiveRecord = wdFirstRecord
           
           End With
           
           Dim s As String
           'loop the datasource count and merge one record at a time
           For i = 1 To x
             .DataSource.FirstRecord = i
             .DataSource.LastRecord = i
             .DataSource.ActiveRecord = i
                 
             .Execute False
           Next i
    End With

In WinXP environment, the job gets printed into the default printer directly, however in Win2K, the print dialog box get displayed.

Does anyone know if this is the behaviour of Word2000? And how can I overcome this?

Thanks!
LVL 1
sataAsked:
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.

GrahamSkanRetiredCommented:
This is pre-Xp behaviour.

This article recommends that you send to a file, and print that.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnovba00/html/MailMergePartI.asp
0

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
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.