Hyerlink Modification help needed

F

Frank

Hello

I have a several hundres pages with content in the following format:
<text as hyperlink><1 empty space><any text any size>

I want to have it converted to somehting like the following:
<Text from oringal hyperlink astext>
<hyperlink as URL from original hyperlink>
<any text any size>

Can someone please help on this?

Thanks for any feedback,
Frank
 
D

Dave Lett

Hi Frank,
This seems to do the trick on my machine.

Dim lLink As Long
Dim oLink As Hyperlink
Dim oRng As Range
For lLink = ActiveDocument.Hyperlinks.Count To 1 Step -1
Set oLink = ActiveDocument.Hyperlinks(lLink)
Set oRng = oLink.Range
oRng.End = oRng.End + 1
oRng.Characters.Last.Delete
oRng.InsertAfter vbCrLf
oRng.InsertBefore Text:=oLink.TextToDisplay & vbCrLf
oLink.TextToDisplay = oLink.Address
Next lLink


HTH,
Dave
 
F

Frank

Awesome!
So many thanks!!!

One thing: Is it possible to strip any applid style to this "range of text"
AND set the "headline" to the Headline 2 style?

Sameple:
<Text from oringal hyperlink as Heading 2>
<hyperlink as URL as URL style>
<some text based on normal style>

Can that be done as well?
Where can I read more on how to make my own makros and fancy stuff like this
here?
 

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