Macro used to print...?

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,
 
R

Russ

Kenneth,
Check VBA Help and search for 'printout' method.
Does the .printout method do what the deprecated wordbasic command did?
It has an option to print one label or a whole sheet of labels with the same
address.
 
K

Kenneth

Kenneth,
Check VBA Help and search for 'printout' method.
Does the .printout method do what the deprecated wordbasic command did?
It has an option to print one label or a whole sheet of labels with the same
address.

Hi Russ,

Thanks for your suggestion, and I will soon give it a try,
but...

I'm having an odd problem with the helpfile on this system
(Word 2000 SP3 under XP). When I launched the VBA help, all
looked fine. But, when I click on the Answer Wizard, or the
Index tab, the mouse cursor goes to "<->" when I move it
over any of the entry fields. (I am trying to draw the
cursor for making the field wider, or narrower.)

With that cursor form, I could not enter anything in the
search field.

In any case, that did not seem like a big deal because I
thought I could just run a Repair. That did nothing to
correct the problem, so I ran a re-install of Office.

Still, I have the problem.

Now, I know this is note a VBA coding thing, but might you
have a suggestion that would allow me to get past this
helpfile hassle?

Sincere thanks,
 
K

Kenneth

Hi Russ,

Thanks for your suggestion, and I will soon give it a try,
but...

I'm having an odd problem with the helpfile on this system
(Word 2000 SP3 under XP). When I launched the VBA help, all
looked fine. But, when I click on the Answer Wizard, or the
Index tab, the mouse cursor goes to "<->" when I move it
over any of the entry fields. (I am trying to draw the
cursor for making the field wider, or narrower.)

With that cursor form, I could not enter anything in the
search field.

In any case, that did not seem like a big deal because I
thought I could just run a Repair. That did nothing to
correct the problem, so I ran a re-install of Office.

Still, I have the problem.

Now, I know this is note a VBA coding thing, but might you
have a suggestion that would allow me to get past this
helpfile hassle?

Sincere thanks,

Hi again Russ,

I am going around in circles with this...

Because I cannot use the helpfile directly, I searched my
system and found that I had an HTML version of the Visual
Basic helpfile. The problem with it is that a search does
not show any instance of the word "PrintOut."

Might you have another thought on this?

Sincere thanks, as before,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top