• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

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!
0
sata
Asked:
sata
1 Solution
 
GrahamSkanCommented:
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now