Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

Macro used to print...?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kenneth - 30 Sep 2006 23:30 GMT
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"
  >>>>>   WordBasic.MailMergePropagateLabel <<<<<<<
       .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,
Signature

Kenneth

If you email... Please remove the "SPAMLESS."

Russ - 01 Oct 2006 01:11 GMT
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.

> Howdy,
>
[quoted text clipped - 59 lines]
>
> Thanks for any help on this,

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Kenneth - 01 Oct 2006 15:29 GMT
>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,
Signature

Kenneth

If you email... Please remove the "SPAMLESS."

Kenneth - 01 Oct 2006 19:45 GMT
>>Kenneth,
>>Check VBA Help and search for 'printout' method.
[quoted text clipped - 28 lines]
>
>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,
Signature

Kenneth

If you email... Please remove the "SPAMLESS."

Russ - 16 Oct 2006 08:19 GMT
Kenneth,

Sorry, I'm behind in reading posts. Below is what is says about the printout
method and a link for info on installing VBA Help.
____________________________________________________________
PrintOut Method (MailingLabel Object)

Prints a label or a page of labels with the same address.
Syntax
expression.PrintOut(Name, Address, ExtractAddress, LaserTray, SingleLabel,
Row, Column)

expression   Required. An expression that returns a MailingLabel object.

Name   Optional Variant. The mailing label name.

Address   Optional Variant. The text for the label address.

ExtractAddress   Optional Variant. True to use the text marked by the
"EnvelopeAddress" bookmark (a user-defined bookmark) as the label text. If
this argument is specified, Address and AutoText are ignored.

LaserTray   Optional Variant. The laser printer tray to be used. Can be any
valid WdPaperTray constant. For a list of valid WdPaperTray constants, see
the Object Browser in the Visual Basic Editor.

SingleLabel   Optional Variant. True to print a single label, False to print
an entire page of the same label.

Row   Optional Variant. The label row for a single label. Not valid if
SingleLabel is False.

Column   Optional Variant. The label column for a single label. Not valid if
SingleLabel is False.
________________________________________________________________

Click on this link for installing VBA Help info:
http://tinyurl.com/pxovv

>>> Kenneth,
>>> Check VBA Help and search for 'printout' method.
[quoted text clipped - 41 lines]
>
> Sincere thanks, as before,

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.