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
Solved

Converting specific data in Word 2010 to an Excel spreadsheet

Posted on 2013-05-22
4
228 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Outlook Free & Paid Tools
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

840 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