K
Kenneth
Howdy,
Below is a macro that I used successfully on a Win 2000 box.
It would run a merge, then print labels.
Now, on a new XP box, it opens the print dialog instead. The
correct printer is chosen, but, in order to print, I must
click OK.
Can you spot the problem, and suggest a modification?
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 9/27/2006 by
'
Documents.Add Template:="F:\Templates\Label 4x2.dot",
NewTemplate:=False, _
DocumentType:=0
Selection.Font.Size = 36
Selection.Font.Bold = wdToggle
ActiveDocument.MailMerge.MainDocumentType =
wdFormLetters
ActiveDocument.MailMerge.OpenDataSource
Name:="Z:\Data\let.txt", _
ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="",
WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="",
SQLStatement:="", SQLStatement1 _
:=""
ActiveDocument.MailMerge.EditMainDocument
ActiveDocument.MailMerge.Fields.Add
Range:=Selection.Range, Name:="First"
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
End Sub
Very sincere thanks,
Below is a macro that I used successfully on a Win 2000 box.
It would run a merge, then print labels.
Now, on a new XP box, it opens the print dialog instead. The
correct printer is chosen, but, in order to print, I must
click OK.
Can you spot the problem, and suggest a modification?
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 9/27/2006 by
'
Documents.Add Template:="F:\Templates\Label 4x2.dot",
NewTemplate:=False, _
DocumentType:=0
Selection.Font.Size = 36
Selection.Font.Bold = wdToggle
ActiveDocument.MailMerge.MainDocumentType =
wdFormLetters
ActiveDocument.MailMerge.OpenDataSource
Name:="Z:\Data\let.txt", _
ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="",
WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="",
SQLStatement:="", SQLStatement1 _
:=""
ActiveDocument.MailMerge.EditMainDocument
ActiveDocument.MailMerge.Fields.Add
Range:=Selection.Range, Name:="First"
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
End Sub
Very sincere thanks,