Solved

Converting specific data in Word 2010 to an Excel spreadsheet

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
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:
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now