Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Freida Freida is offline
external usenet poster
 
Posts: 10
Default extracting address from a word document and merging them to label

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?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default extracting address from a word document and merging them to label

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.

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

"Freida" wrote in message
...
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?



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Freida Freida is offline
external usenet poster
 
Posts: 10
Default extracting address from a word document and merging them to la

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.

"Doug Robbins - Word MVP" wrote:

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.

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

"Freida" wrote in message
...
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?




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default extracting address from a word document and merging them to la

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


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

"Freida" wrote in message
...
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.

"Doug Robbins - Word MVP" wrote:

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.

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

"Freida" wrote in message
...
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?






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
word adding additional text merging e-mail address from access Andrew R Mailmerge 7 September 12th 06 08:29 PM
MS Word merging data into a single document from Database [email protected] Mailmerge 1 June 21st 06 04:45 AM
WP merge file to Word sstires Tables 4 February 14th 06 06:26 PM
Why isn't all my Excel data merging into my Word labels document? Cindy Meister Mailmerge 0 August 6th 05 09:19 AM
How do I create & merge specific data base & master documents? maggiev New Users 2 January 12th 05 11:30 PM


All times are GMT +1. The time now is 08:15 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"