Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adjust Label setting in Microsoft Word

Status
Not open for further replies.

phenomenix

Programmer
Dec 14, 2004
1
US
Problem: VBA / Microsoft Word / Address label printing / accessing the 'Number Down:' setting

I need to be able to access the "Number down:" setting in the Labels Options Details section using VB code.

The field I want to change can be found manually here:
Tools/Letters and Mailings/Envelopes and Labels/labels[tab]/Details/Number Down:

I tried recording a macro and changing that field to see how VBA handles it, but the field becomes unavailable if a macro is recording.

Anyone know how I can alter that field within my VBA code?

Here is the command I'm giving to print the label:

Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.PrintOut Name:="AE (2x4)", Address:=line1$, _
ExtractAddress:=False, LaserTray:=wdPrinterUpperBin, SingleLabel:=False, _
PrintEPostageLabel:=False, Vertical:=False

But if I tell it to print more than one (say in a For Next loop) it FormFeeds between printings. I want to use a variable to set that field to tell it how many labels I want to print each time.

Any help is appreciated!
 
Hi phenomenix,

If you manually change any element of a built-in label, Word will create a custom label based on the built-in label with your changes applied.

Unfortunately, AFAIK there is no way to copy a built-in label definition - or even to access its properties in VBA, which is a bit of a restriction. The best thing to do is probably to manually create a custom label and then you can access its properties like this:

[blue][tt] Application.MailingLabel.CustomLabels("mytest").NumberDown[/tt][/blue]

However I'm not sure from the rest of your post whether that is actually what you want to do. Printing out labels always results in a whole number of pages per printout. You must build up the data you want before printing - that is equally true manually.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top