#1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Manos Manos is offline
external usenet poster
 
Posts: 1
Default repeat a print

Dear all

I export data from a programe which drop all exports in excel and then
direct to word for print. i have a field which givem e the quantity of an
item.
How can i declare in the mail merge to print a label of this item so many
times as the quantity, form the specific field?

Any examples?


Thanks in advance
Manos
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default repeat a print

Have a look (e.g. using Google Groups) at the conversation titled "Merge
recipient multiple times" started by "Laser Apparel" on 11 Oct 2007.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Manos" wrote in message
...
Dear all

I export data from a programe which drop all exports in excel and then
direct to word for print. i have a field which givem e the quantity of an
item.
How can i declare in the mail merge to print a label of this item so many
times as the quantity, form the specific field?

Any examples?


Thanks in advance
Manos


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default repeat a print

There is another method that may work for you, as long as you know the
maximum quantity. It needs some Word VBA to set up the data source. It may
not work if there are a large number of labels, or if you have "memo" type
data (long text fields).

Suppose your data is in an Excel file called c:\mydata\labels.xls, is in
Sheet1, and has three columns:

k,labeldata, quantity

k needs to be a unique identifier for the record (because it is used in a
sort). If necessary, you might be able to use labeldata or a unique
combination of the other fields for this value

Create a new Excel file called c:\mydata\multiplier.xls. In Sheet1, create
one column called multiplier and put the following data in it:

1
2
2
3
3
3
4
4
4
4
5
5
5
5
5
....
and so on (i.e. you need 15 rows with the number 15, 100 rows with the
number 100. The largest number must be equal to or greater than the maximum
number in your "quantity" column.

Use the following Word VBA to connect to the data source:

Sub ConnectMultiple()
' You can define more of the constants here if you really want
Dim strData As String
Dim strKeyColumn As String
Dim strQuantityColumn As String
Dim strMultiplier As String
strData = "c:\mydata\labels.xls"
strKeyColumn = "k"
strQuantityColumn = "quantity"
strMultiplier= c:\mydata\multiplier.xls"
ActiveDocument.MailMerge.OpenDataSource _
Name:=strData, _
SQLStatement:="SELECT [d].* FROM [" & strData &"].[Sheet1$] [d]" & _
" LEFT JOIN [" & strMultiplier & "].[Sheet1$]
[m]" & _
" ON [d].[" & strQuantityColumn & "] =
[m].[multiplier]" & _
" ORDER BY [d].[" & strKeyColumn & "]"
End Sub

Make sure there is a space after the " in those last few lines.

For further info. on how to install and run Word VBA Macros, see e.g. Graham
Mayor's article at

http://www.gmayor.com/installing_macro.htm

If you do try this please preview the records to check that the correct
number of each record has been inserted. I would also be interested to know
if it works for you.
--
Peter Jamieson
http://tips.pjmsn.me.uk

"Manos" wrote in message
...
Dear all

I export data from a programe which drop all exports in excel and then
direct to word for print. i have a field which givem e the quantity of an
item.
How can i declare in the mail merge to print a label of this item so many
times as the quantity, form the specific field?

Any examples?


Thanks in advance
Manos


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
F4 to repeat last action Idaho Word Man Microsoft Word Help 5 March 1st 07 03:51 PM
repeat row headers Bob Griendling Tables 3 January 31st 07 10:56 PM
I want fields to repeat - please help! Narowr Mailmerge 2 May 12th 06 05:50 AM
Repeat a macro? JLeck Microsoft Word Help 2 December 16th 05 06:59 PM
Cannot get row to repeat Robert Judge Tables 1 November 20th 04 10:23 PM


All times are GMT +1. The time now is 08:19 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"