I have a word document with several sections. At the begining of each
section, there is a vendor name and address. I want to creat a label merge
that copies the addresses contained at the beg. of each section onto the
labels. Is this possible?
It is possible to do such a thing using Visual Basic. For a document with
only several sections, it is probably not worth the effort of creating the
necessary macro, unless it is something that you have to do on a regular
basis.
To give any specific information on how to go about it, it would be
necessary for you to provide additional information on how the address
appears at the beginning of each section of the document.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I have a word document with several sections. At the begining of each
> section, there is a vendor name and address. I want to creat a label
> merge
> that copies the addresses contained at the beg. of each section onto the
> labels. Is this possible?
Freida - 30 Jan 2007 20:55 GMT
The 1st 4 lines of each section include the vendor name and the address.
This is something that will need to be done on a regular basis, I made need
the macro for this one. At any give time this doc. Can have anywhere from
10 to 40 sections depending on how often the report is ran.
> It is possible to do such a thing using Visual Basic. For a document with
> only several sections, it is probably not worth the effort of creating the
[quoted text clipped - 10 lines]
> > that copies the addresses contained at the beg. of each section onto the
> > labels. Is this possible?
Doug Robbins - Word MVP - 31 Jan 2007 04:51 GMT
And is each line a separate paragraph ending in a ¶ (when you click on the
Show/Hide button (¶))?
If that is the case, this code should do it:
Dim i As Long, j As Long
Dim source As Document, target As Document
Dim arange As Range, srange As Range
Set source = ActiveDocument
Set target = Documents.Add
With source
For i = 1 To .Sections.Count
For j = 1 To 3
Set srange = .Sections(i).Range
Set arange = srange.Paragraphs(j).Range
arange.End = arange.End - 1
target.Range.InsertAfter arange & vbTab
Next j
Set arange = srange.Paragraphs(4).Range
target.Range.InsertAfter arange
Next i
End With

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> The 1st 4 lines of each section include the vendor name and the address.
> This is something that will need to be done on a regular basis, I made
[quoted text clipped - 20 lines]
>> > the
>> > labels. Is this possible?