Q
Quetzalcoatl
Hi,
1/ I've got a Word 97 file, which contains, here and there, references to other
documents. Those "external" documents are located on my company internal network
and can be reached via a "http://......-type address. The root of the address is
a function of the external document type and the remaining of the address
corresponds to the reference of the external document.
I'd like to use a VBA macro in order to:
- scan each word in my file
- detect if the word contains a reference to an external document
- associate to this reference the appropriate hypertext link pointing on the
http address of the external document.
This macro would be based on a table giving the structure of the various
possible references and the associated addresses, for example :
CONTRACT_aa_nnn/nnn --> http://company_network/contracts/
CARD_nnnn/aaaa --> http://company_network/product_cards/
a.s.o...
where CONTRACT, CARD, _, / are respectively the following character string:
"CONTRACT", "CARD", "_", "/"
and where aa represents 2 alphanumeric characters, aaaa 4 alphanumeric
characters, nnn 3 numeric characters, nnnn 4 numeric characters.
Possible use of wildcard characters ("*" or "?") would be appreciated.
Perhaps it should be advisable to avoid to associate a link where there is
already one.
2/ I'd like also to use a macro which would be able to undo what is done by the
macro in 1/, that is to say to delete the hypertext links:
- option 1 : on the basis of the table above,
- option 2 : all the links in the file.
Would somebody be kind enough to help me, I'm just gropping in the dark ?
Thanks.
1/ I've got a Word 97 file, which contains, here and there, references to other
documents. Those "external" documents are located on my company internal network
and can be reached via a "http://......-type address. The root of the address is
a function of the external document type and the remaining of the address
corresponds to the reference of the external document.
I'd like to use a VBA macro in order to:
- scan each word in my file
- detect if the word contains a reference to an external document
- associate to this reference the appropriate hypertext link pointing on the
http address of the external document.
This macro would be based on a table giving the structure of the various
possible references and the associated addresses, for example :
CONTRACT_aa_nnn/nnn --> http://company_network/contracts/
CARD_nnnn/aaaa --> http://company_network/product_cards/
a.s.o...
where CONTRACT, CARD, _, / are respectively the following character string:
"CONTRACT", "CARD", "_", "/"
and where aa represents 2 alphanumeric characters, aaaa 4 alphanumeric
characters, nnn 3 numeric characters, nnnn 4 numeric characters.
Possible use of wildcard characters ("*" or "?") would be appreciated.
Perhaps it should be advisable to avoid to associate a link where there is
already one.
2/ I'd like also to use a macro which would be able to undo what is done by the
macro in 1/, that is to say to delete the hypertext links:
- option 1 : on the basis of the table above,
- option 2 : all the links in the file.
Would somebody be kind enough to help me, I'm just gropping in the dark ?
Thanks.