Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

Converting specific data in Word 2010 to an Excel spreadsheet

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
mzimerman
Asked:
mzimerman
  • 3
1 Solution
 
GrahamSkanCommented:
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
 
GrahamSkanCommented:
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
 
mzimermanAuthor Commented:
Not any other responses so you get all the points. Your solution is very close to the find algorithm I'm currently using.
0
 
GrahamSkanCommented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now