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 / Mailmerge and Fax / December 2003

Tip: Looking for answers? Try searching our database.

Get address from all letters in a folder...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Faye - 12 Dec 2003 04:51 GMT
Hello
I've searched the newsgroups, but can't find anything on this.  I hope someone can help me do this
I need to loop through all letters in a folder, extract the delivery address from each, and add it to a list to create an address list of all receipients of these letters.  This is a kind of reverse mail merge where a 'data' file (just a tab delimited list in a document) is created from the letters instead of the opposite. I know that there's an activedocument.envelope.address.text property, but none of these letters have an envelope.  How does Word extract these 'Inside addresses' for the E&L wizard
Thank you! ( Using Word97)
Faye - 12 Dec 2003 11:16 GMT
In case anyone wants to use it or comment...
Sub GrabAddresses()
Dim vFile As String
Dim PathToUse As String
Dim vDoc As Document
Dim vAddr As String

PathToUse = "C:\Documed\List Maker\Files\"
 On Error Resume Next
   vFile = Dir$(PathToUse & "*.doc")
     While vFile <> ""
       Set vDoc = Documents.Open(PathToUse & vFile)
         Selection.Find.ClearFormatting
         Selection.Find.Font.Underline = wdUnderlineSingle
         Selection.Find.Replacement.ClearFormatting
         Selection.Find.Replacement.Font.Underline = wdUnderlineNone
         With Selection.Find
           .Text = ""
           .Replacement.Text = ""
           .Forward = True
           .Wrap = wdFindContinue
           .Format = True
           .MatchCase = False
           .MatchWholeWord = False
           .MatchWildcards = False
           .MatchSoundsLike = False
           .MatchAllWordForms = False
         End With
         Selection.Find.Execute Replace:=wdReplaceAll
vDoc.envelope.Insert
 vAddr = vDoc.envelope.Address.Text
   Documents("List.doc").Activate
     Selection.EndKey Unit:=wdStory
     Selection.TypeText (vAddr)
     Selection.TypeText vbCr
     Selection.TypeText Text:="~"
     Selection.TypeText vbCr
vDoc.Close SaveChanges:=wdDoNotSaveChanges
   vFile = Dir$()
Wend
End Sub

    ----- Faye wrote: -----
 
    Hello,
    I've searched the newsgroups, but can't find anything on this.  I hope someone can help me do this.
    I need to loop through all letters in a folder, extract the delivery address from each, and add it to a list to create an address list of all receipients of these letters.  This is a kind of reverse mail merge where a 'data' file (just a tab delimited list in a document) is created from the letters instead of the opposite. I know that there's an activedocument.envelope.address.text property, but none of these letters have an envelope.  How does Word extract these 'Inside addresses' for the E&L wizard?
    Thank you! ( Using Word97)
 
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.