![]() |
#1
|
|||
|
|||
![]()
Hi everyone,
I have been given the following task and I am not sure how to do it. Can anyone help? I need to do the following: I have a Word-document with a big number of hyperlinks in it, about 400. When the links were created, they were created in an erroneous way, so what I would like to do is to go from hyperlink to hyperlink and edit the incorrect URL and through some string manipulation create a correct URL and then put it back in again. The error it seems, is made in a systematic way, so there is really only a problem identifying various parts of the string. That is not a problem. The problem is how to do this through VBA-code. Can it be done? Is there a collection of hyperlinks through which I can traverse? Grateful for any help Bengt |
#2
|
|||
|
|||
![]()
Something like this:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey Dim oHL As Hyperlink For Each oHL In ActiveDocument.Hyperlinks oHL.Address = Replace(oHL.Address, "http", "https") Next oHL lbl_Exit: Exit Sub End Sub |
#3
|
|||
|
|||
![]()
Dear Greg,
Thanks a lot. It looks like something that I could use. Good that you pointed out that there is a Collection of hyperlinks. I didn't know that. I'll work with your code suggestion and try to expand it. Bengt |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hyperlink: open the document only once, quit & reopen PP, hyperlink doesnt work anymore | quanghuynguyenhua | PowerPoint | 0 | 10-10-2015 06:17 PM |
Hyperlink Format varies, depending on whether Target file was saved or unsaved on Hyperlink Copy | RichardDavey | Word | 0 | 05-26-2015 05:26 PM |
![]() |
PRADEEPB270 | Excel | 1 | 02-22-2013 09:47 AM |
![]() |
shira47 | Word | 1 | 03-22-2012 03:40 PM |
![]() |
MrWord | Word VBA | 2 | 02-07-2012 05:56 PM |