Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-16-2012, 12:01 AM
donlincolnmsof donlincolnmsof is offline Extract phone number from word file Windows 7 64bit Extract phone number from word file Office 2003
Advanced Beginner
Extract phone number from word file
 
Join Date: Oct 2011
Posts: 36
donlincolnmsof is on a distinguished road
Smile

Hello Paul



Thanks for replying back to me.

Below is my response



In your latest post you have numerous references to 'beginning code=abc' and 'ending code=xyz'. What are the actual codes? Does the same phone number appear with more than one kind of 'bunch of data' and, if so, what is to be done in such cases?

The beginning code is FirstN and the ending code is LastN

Between the begin code and end code there are other items and those change all the time
like address, ss#, dob, phone number, place of business

so the line record looks something like this.

FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith.

And then there is bunch of garbage data, af;adkfjakfjadfjadfjdfasdfadfasdfadfsdfdsfdfdsafad safasfdfs

Then the records begins again in the garbage data, as the above sequence.


So data looks something like this.

Sffsaffafa afadfadfasdfadf adfafdadfasdfdsfsaf sdfadfsdf FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith. Sfdfsdfsaf fadfasdfsfsffa sdfasdfasdfsadf fsadfadsfasdf sdfadfasf FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith. Dfsdfsfadfasfa afsadfd asdfasdfas sfdafdaf sdfsdfsfa sfdfsfdsf FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith. Asfasfsfdfsfa sfsfdfsfs sfdfsfdsfs FirstN=Dave, address=345 xyz street, ss#=444-44-444, dob=09-08-2008, phone=908-555-1212, place of business=abczey co, LastN=Bartel. Sdfsdfdsf sdfadfafkjl a fafjdfajd;fk; asdff sdfsddfsdf sfdfsfdsf sfsfdfsfs sfdfsfdsfs FirstN=Dave, address=345 xyz street, ss#=444-44-444, dob=09-08-2008, phone=908-555-1212, place of business=abczey co, LastN=Bartel. Sdfsdfdsf sdfadfafkjl a fafjdfajd;fk; asdff sdfsddfsdf sfdfsfdsf sfsfdfsfs sfdfsfdsfs FirstN=Dave, address=345 xyz street, ss#=444-44-444, dob=09-08-2008, phone=908-555-1212, place of business=abczey co, LastN=Bartel. Sdfsdfdsf sdfadfafkjl a fafjdfajd;fk; asdff sdfsddfsdf sfdfsfdsf sfsfdfsfs sfdfsfdsfs FirstN=Dave, address=345 xyz street, ss#=444-44-444, dob=09-08-2008, phone=908-555-1212, place of business=abczey co, LastN=Bartel. Sdfsdfdsf sdfadfafkjl a fafjdfajd;fk; asdff sdfsddfsdf sfdfsfdsf

so as you can see from the above data, I need to pull the record out of this data

a record is considred

FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith.

and it’s a TEXT file with continuous data, one thing is good that the once the 1st number is found the duplicate number and next few duplicate numbers appears right in the flow of the file like in the above data and they don’t appear anywhere else in the file.

Does the same phone number appear with more than one kind of 'bunch of data' and, if so, what is to be done in such cases?

No the bunch of data and phone numbers are always same, so I only need to extract one time and if the next number is duplicate then the macro should skip it, since deleting will take too much time for the file to adjust upward.


It's not apparent what your use of:

Code:
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtendis for.

It doesn't seem to have any logical connection with the data you've posted. Perhaps you could explain this.

Yeah you can ignore the code that I posted, I’m using windows 7 and word 2003, ( forgot to mentioned that earlier) but don’t need the above code. I used word 2003 macro record functions to record the macro keystrokes.

If you can extract the data that I mentioned some how then that’s all I need.



Finally, you refer to 'take out that whole record into a new window'. I take it you mean another document. Is this a new document or an existing document that you need the content pasted into?

Just a new document window and switching back and forth to extract the data from the main window and then put in the other window.


PS: When posting code, please use the code tags - they're on the 'Advanced' screen.
I will try, not too familiar with the system.


I will really appreciate all your help

Thanks.!!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract phone number from word file Extract Video from .ppsx file designer PowerPoint 1 10-14-2011 08:00 AM
Extract phone number from word file Phone number formatting Mark Micallef Outlook 1 08-04-2010 02:38 PM
Can I Extract a Page from Word and Make a New DOCX File? tatihulot Word 1 06-20-2010 11:38 PM
in WORD, how do i type a 9-digit phone number "xxxxxxxxx" and have it automatically.. jay8962 Word 0 04-08-2010 11:08 AM
automatically extract footnotes into new file and apply character format to footnote hrdwa Word 0 02-27-2010 03:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft