Solved

Converting specific data in Word 2010 to an Excel spreadsheet

Posted on 2013-05-22
4
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

717 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