Making Hypher link by collectin strings

R

Reddy Reddy

hi,
i want to copy some codes there between two words and paste at one place( write at one place) and make the line hypherlink and open the link.
the default line will be http://www.sec.gov/Archives/edgar/data/
and actual link is like this

http://www.sec.gov/Archives/edgar/data/776867/000110465906021419/a06-7859_1def14a.htm

in the above link up to data/ default and remaining number and code and file name available at word. now i it has to copy those codes between the words and paste at beside the link data/......

the codes always available between same words, but the codes may change file to file.
the below i am giving file text;
in that i given ** for those code which i need to collect between the words and out at one place. and this should applicable for first and second page of the wordfile.

Conditions:
1. Cik number should ignore 0000's, take only numbers

Ex. 0000776867 = take like this 776867 ( it is available between the words <CIK>0000776867<ASSIGNED-SIC> in the below file)

2. and Accession number should ignore " - "( symbols) in that number

Ex. 0001104659-06-021419 = 000110465906021419 ( it is available between the words <ACCESSION-NUMBER> 0001104659-06-021419 <TYPE> in the below file)

3. after Accesion number File name shoul be thre as it is

Ex. a06-7859_1def14a.htm ( it is available between the words <FILENAME> a06-7859_1def14a.htm <DESCRIPTION>

my main objective is i need macro code , when i run the macro, make a hypher link and open the page at inernet by collecting those strings mentioned above from word file .

Ex. http://www.sec.gov/Archives/edgar/data/776867/000110465906021419/a06-7859_1def14a.htm

i hope any one can heplp to me

advance thanks.

reddy

----------------------------------------------------

here the sample file:

0001104659-06-021419DEF 14A WHITE MOUNTAINS INSURANCE GROUP LTD 2006033120060331180218180220180220 0 <SUBMISSION>
<ACCESSION-NUMBER>**0001104659-06-021419**
<TYPE>DEF 14A
<PUBLIC-DOCUMENT-COUNT>9
<PERIOD>20060525
<FILING-DATE>20060403
<DATE-OF-FILING-DATE-CHANGE>20060331
<EFFECTIVENESS-DATE>20060403
<FILER>
<COMPANY-DATA>
<CONFORMED-NAME>WHITE MOUNTAINS INSURANCE GROUP LTD
<CIK>**0000776867**
<ASSIGNED-SIC>6331
<IRS-NUMBER>942708455
<STATE-OF-INCORPORATION>D0
<FISCAL-YEAR-END>1231
</COMPANY-DATA>
<FILING-VALUES>
<FORM-TYPE>DEF 14A
<ACT>34
<FILE-NUMBER>001-08993
<FILM-NUMBER>06730628
</FILING-VALUES>
<BUSINESS-ADDRESS>
<STREET1>80 SOUTH MAIN ST
<CITY>HANOVER
<STATE>NH
<ZIP>03755
<PHONE>603 640 2200
</BUSINESS-ADDRESS>
<MAIL-ADDRESS>
<STREET1>80 SOUTH MAIN STREET
<CITY>HANOVER
<STATE>NH
<ZIP>03755
</MAIL-ADDRESS>
<FORMER-COMPANY>
<FORMER-CONFORMED-NAME>WHITE MOUNTAINS INSURANCE GROUP INC
<DATE-CHANGED>19990603
</FORMER-COMPANY>
<FORMER-COMPANY>
<FORMER-CONFORMED-NAME>FUND AMERICAN ENTERPRISES HOLDINGS INC
<DATE-CHANGED>19920703
</FORMER-COMPANY>
<FORMER-COMPANY>
<FORMER-CONFORMED-NAME>FUND AMERICAN COMPANIES INC
<DATE-CHANGED>19920701
</FORMER-COMPANY>
</FILER>
<DOCUMENT>
<TYPE>DEF 14A
<SEQUENCE>1
<FILENAME>**a06-7859_1def14a.htm**
<DESCRIPTION>DEFINITIVE PROXY STATEMENT
<TEXT><html>
 
T

Tony Jollans

Your sample has a lot of line breaks. I don't know if the real file has or
not but this code should work either way:

With ActiveDocument.Range
.Find.Execute "\<CIK\>*[!0-9]", MatchWildcards:=True
Str1 = Replace(Mid(.Text, 6, Len(.Text) - 6), "0", "")
End With
With ActiveDocument.Range
.Find.Execute "\<ACCESSION-NUMBER\>*[!\-0-9]", MatchWildcards:=True
Str2 = Replace(Mid(.Text, 19, Len(.Text) - 19), "-", "")
End With
With ActiveDocument.Range
.Find.Execute "\<FILENAME\>*[^11\<]", MatchWildcards:=True
Str3 = Mid(.Text, 11, Len(.Text) - 11)
End With
ActiveDocument.FollowHyperlink "http://www.sec.gov/Archives/edgar/data/" _
& Str1 & "/" & Str2 & "/" & Str3
 
Top