How do i parse a word document usin a macro to get the text inside

A

adi

Hi,
I have a document which contains a fax number inside it.
How can i open this document(from a macro) and read the document and get the
fax number? I want the faxnumber to be read from the macro, so that the macro
can fax the document to that number attatching the document just read.
Thanks for your help.
Regards,
Adi
 
J

Jezebel

No way to answer that without knowing where in the document the number is
located and how you'll recognise it.
 
G

Graham Mayor

For an existing document, without knowing how the document is laid out and
where the fax number is located (or how it may be distinguished from - say -
a telephone number) what the sequence of numbers may be that constitutes the
fax number and what the associated text may be, this is impossible to
answer.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

adi

Jezebel/Graham,
Sorry. I missed that part of information.
The fax number will be preceded by 'Fax Number:' that means this is how the
document looks inside

Name: Nancy
Fax Number: 732-456-3425
Address: 134 Hillside,Edison,NJ

Fax Number always appears in the second line. Always in the same column
location.

Please letme know if you need any more info.

Also once i get the fax number(line 2) and address(line 3) from the
document, can i rename the same document embedding the address and fax number
in the name field?

That means if the document i am reading has name like document1, can i
rename it like 134Hillside-Edison-NJ-732-456-3425 ?


Thanks for your help,
Regards,
Adi
 
A

Adi

Jezebel/Graham,
Sorry. I missed that part of information.
The fax number will be preceded by 'Fax Number:' that means this is how the
document looks inside

Name: Nancy
Fax Number: 732-456-3425
Address: 134 Hillside,Edison,NJ

Fax Number always appears in the second line. Always in the same column
location.

Please letme know if you need any more info.

Also once i get the fax number(line 2) and address(line 3) from the
document, can i rename the same document embedding the address and fax number
in the name field?

That means if the document i am reading has name like document1, can i
rename it like 134Hillside-Edison-NJ-732-456-3425 ?


Thanks for your help,
Regards,
Adi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top