Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro to Extract URL from Hyperlink and Insert on New Line?
Hi All - I'm really hoping someone can help me with this one, as it will save a tremedous amount of time.
I have a few very lengthy documents that are in outline form. Scattered throughout each of the documents are hyperlinks. I need to take the URL that the hyperlink points to and paste it below the line containing the hyperlink. For example: Before -- A3. Search Engines a. One of the most popular - Google After -- A3. Search Engines a. One of the most popular - Google www.google.com Where the "Google" text in the "before example" is a hyperlink to www.google.com Is there any way that I can acomplish this in Word 2010 via an automated method? Thank you in advance for the assistance. I greatly appreciate it! Last edited by zcrane : June 20th 12 at 07:41 PM |
#2
|
|||
|
|||
This is currently what I have, but it does not function correctly.
Sub URLCapture() ' ' URLCapture Macro ' ' Dim HLink As Hyperlink Dim strAddress As String For Each HLink In ActiveDocument.Hyperlinks strAddress = HLink.Address Selection.EndKey Unit:=wdLine Selection.TypeParagraph Selection.TypeText Text:=strAddress Next HLink End Sub Quote:
|
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Macro to Extract URL from Hyperlink and Insert on New Line?
Is the linked text always in a separate paragraph (that is, you typed Enter
between the text lines in your example)? In that case, you should be able to use a macro that goes through each paragraph, extracts the URL of any hyperlink present, and adds it in a new paragraph below. -- Stefan Blom Microsoft Word MVP "zcrane" wrote in message ... Hi All - I'm really hoping someone can help me with this one, as it will save a tremedous amount of time. I have a few very lengthy documents that are in outline form. Scattered throughout each of the documents are hyperlinks. I need to take the URL that the hyperlink points to and paste it below the line containing the hyperlink. For example: Before -- A3. Search Engines a. One of the most popular - Google After -- A3. Search Engines a. One of the most popular - Google www.google.com Where the "Google" text in the "before example" is a hyperlink to www.google.com Is there any way that I can acomplish this in Word 2010 via an automated method? Thank you in advance for the assistance. I greatly appreciate it! -- zcrane |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
hyperlink url truncated... | Microsoft Word Help | |||
URL in Hyperlink Filed in Access | Microsoft Word Help | |||
Hide url in hyperlink | Microsoft Word Help | |||
How to create an email from mail merge including a hyperlink, so that the value of a merged field is included as part of the hyperlink URL, not just part of its text. | Mailmerge | |||
How to create an email from mail merge including a hyperlink, so that the value of a merged field is included as part of the hyperlink URL, not just part of its text. | Mailmerge |