Solved

Converting specific data in Word 2010 to an Excel spreadsheet

Posted on 2013-05-22
4
227 Views
Last Modified: 2013-05-28
I would like to extract data from a large Microsoft Word 2010 document, preferably using an automated process. The specific data that I am looking for is e-mail addresses embedded in the word document. I have used some of the advanced find algorithms to locate and copy some of these e-mail addresses to Excel, but I am looking for any other options that might be available if this was possible. Some of the data that I could use includes the first and last names of the people associated with the given e-mail address.
The find mechanism (advanced find) seems more geared towards finding a specific string value or escape character and although this is helpful it does not meet all of my needs. Are there character strings that could be used within the advanced find mechanism to accomplish this? Is there any other mechanism, even including some type of commercial software that could parse out the character strings that I'm looking for any better than the Word 2010 options? Or would it be better to have someone write code, maybe in Python, that could accomplish this end in a more practical manner? How hard would that be to do? I'm open to any and all suggestions on how this could be accomplished. All help gratefully accepted, including options that I have not mentioned or thought of. Thanks.
0
Comment
Question by:mzimerman
  • 3
4 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39188909
Not sure what you mean by advanced find.

If you are using Word's wildcard find, this is pretty good:

<[A-z0-9\-._]{2,}[\@]{1}<[A-z0-9\-._]{2,}>
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 39188970
Here it is automated as a Word macro:
Sub FindEmail()
Dim rng As Range
Dim doc1 As Document
Dim doc2 As Document

Set doc1 = ActiveDocument
Set doc2 = Documents.Add
Set rng = doc1.Range
With rng.Find
    .Text = "<[A-z0-9\-._]{2,}[\@]{1}<[A-z0-9\-._]{2,}>"
    .MatchWildcards = True
    Do While .Execute
        rng.Copy
        doc2.Bookmarks("\EndOfDoc").Range.Paste
        doc2.Bookmarks("\EndOfDoc").Range.Text = vbCr
    Loop
End With
End Sub

Open in new window

0
 

Author Closing Comment

by:mzimerman
ID: 39203171
Not any other responses so you get all the points. Your solution is very close to the find algorithm I'm currently using.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39203207
Thanks. Don't be afraid to request classification/small tweaks. Most experts will not intervene in a question that appears to be adequately covered. An elapse of a day or two sends that message, so if the answer is in any way inadequate, let us know.

In case I imply otherwise, I should add that we would resist designing and writing a whole project
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question