Posted to microsoft.public.word.docmanagement
|
|
Extract phone number from word file
Row.Filtered- the easiest method of displaying or hiding data.With this method the programmer has to control row visibility manually.
http://www.dapfor.com/en/net-suite/n...data-filtering
On Thursday, June 14, 2012 5:56 PM Don Lincoln wrote:
Hello
I’m looking for a word macro that will extract numbers from a word file
Its has bunch of numbers. The format of those numbers are ###+###-####,
so it’s a 10 digit format after first 3 digits there is a plus sign and
then after 3 digits there is a minus sign and then the last 4 digits.
What the macro should do is find the phone number and extract that into
a new word window and then if the there is a DUPLICATE OF THAT NUMBER
then the word should SKIP THAT NUMBER. and then search and extract the
next number since the file has lots of duplcate number and i only need
unique numbers.
Below is the sample data,
data data data data data data data data data data data data data data
data 951+907-3887 data data data data data data data data data data data
data data data data 951+907-3887 data data data data data data data data
data data data data data data data 951+907-3887 data data data data data
data data data data data data data data data data 916+555-1212 data data
data data data data data data data data data data data data data
916+555-1212 data data data data data data data data data data data data
data data data
Thanks.
--
Don Lincoln
On Friday, June 15, 2012 2:12 AM Lisa Wilke-Thissen wrote:
Hi,
which version of Word?
No macro, but you can choose the "Find" command to select all those
numbers. And then copy and paste them into another document (I would
prefer an Excel sheet):
1. Ctrl + H | Find | More
2. Find what: ^#^#^#+^#^#^#-^#^#^#^#
3. Find in: Main document
All instances will be selected. So you can copy/paste them at once.
In Excel 2010 you can easily remove duplicates:
On the Data tab, in the Data Tools group, click Remove Duplicates.
--
Cheers
Lisa [MS MVP Word]
|