K
Kenneth
Howdy,
I had a macro (Word 2000 SP3) that worked properly under Win
2000 Pro.
Now, under Win XP, it behaves differently. Formerly, it did
a merge, and printed the result. Now, instead, it does the
merge, and opens the Print Dialog. There it stays until I
click "OK" to print.
I had tried SendKeys "~" but with no luck.
Originally, I had created the macro by recording, and then
tweaking.
With the help of a kind person on another group, I stripped
out the extraneous stuff that the recorded generates to get
the code just below.
It generates the Run Time Error 438 "Object doesn't support
this property or method on the line I have marked.
Sub Macro8()
'
' NameTagsFirst Macro
' Macro created 5/30/2002 by Kenneth
'
'
Documents.Add Template:="F:\Templates\Label 4x2.dot"
ActivePrinter = "OKI"
Selection.Font.Size = 36
Selection.Font.Bold = True
With ActiveDocument.MailMerge
.MainDocumentType = wdMailingLabels
.OpenDataSource Name:="Z:\data\let.txt"
.EditMainDocument
.Fields.Add Range:=Selection.Range, Name:="First".Destination = wdSendToPrinter
.SuppressBlankLines = True
.Execute
End With
ActivePrinter = "HP Color LaserJet 2500 PCL 6"
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
Application.ScreenUpdating = True
Application.Quit
End Sub
Apparently, Word 2000 does not support
WordBasic.MailMergePropagateLabel, but I don't know what to
replace that with.
I will also add that in my original version, I did not
record choosing "Mailing Labels." Instead, I chose
"Formletters" though, in fact, I was printing those
"letters" using a template that was 4"x2".
Thanks for any help on this,
I had a macro (Word 2000 SP3) that worked properly under Win
2000 Pro.
Now, under Win XP, it behaves differently. Formerly, it did
a merge, and printed the result. Now, instead, it does the
merge, and opens the Print Dialog. There it stays until I
click "OK" to print.
I had tried SendKeys "~" but with no luck.
Originally, I had created the macro by recording, and then
tweaking.
With the help of a kind person on another group, I stripped
out the extraneous stuff that the recorded generates to get
the code just below.
It generates the Run Time Error 438 "Object doesn't support
this property or method on the line I have marked.
Sub Macro8()
'
' NameTagsFirst Macro
' Macro created 5/30/2002 by Kenneth
'
'
Documents.Add Template:="F:\Templates\Label 4x2.dot"
ActivePrinter = "OKI"
Selection.Font.Size = 36
Selection.Font.Bold = True
With ActiveDocument.MailMerge
.MainDocumentType = wdMailingLabels
.OpenDataSource Name:="Z:\data\let.txt"
.EditMainDocument
.Fields.Add Range:=Selection.Range, Name:="First".Destination = wdSendToPrinter
.SuppressBlankLines = True
.Execute
End With
ActivePrinter = "HP Color LaserJet 2500 PCL 6"
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
Application.ScreenUpdating = True
Application.Quit
End Sub
Apparently, Word 2000 does not support
WordBasic.MailMergePropagateLabel, but I don't know what to
replace that with.
I will also add that in my original version, I did not
record choosing "Mailing Labels." Instead, I chose
"Formletters" though, in fact, I was printing those
"letters" using a template that was 4"x2".
Thanks for any help on this,