#1
|
|||
|
|||
Flagging Hyperlinks using search & replace?
Looking for Technical Advice:
I found out recently that hyperlinks in MS Word don't carry over into InDesign. They are lost in the conversion. My manuscripts of late include boatloads of hyperlinks meant to function as in a wiki document. Obviously I want to prevent the layout artist from having to manually enter them back into the text. That's my 800 lb gorilla today. An idea that came up was to insert the letters (HL) just *before* hyperlinks, as a way to make it easy for the layout artist to zero in on the missing links (no pun intended) without going bananas. I tried using Word's search & replace function, looking for underlines (fortunately, I don't use underlines anywhere else but in hyperlinks). The trouble with this is that the entire underlined statement gets replaced with the (HL) entry, which entirely defeats the purpose. It's what I call a monkey wrench. Digital peanuts haven't helped. It sounds like this is a job better handled with a Macro. I used to write those in my sleep back in the days of Wordperfect. Alas, MS Word uses a language making a chimp out of me. Does anyone have a better idea on how to approach this? Thanks!! |
#2
|
||||
|
||||
You could do a Find/Replace with:
Find = empty Replace = <HL>^&<\HL> specifying the Hyperlink Style for the Find parameter. This adds the <HL> & <\HL> tags to the hyperlinks, though. Alternatively, if you press Alt-F9 to expose Word's field coding, you could do a Find/Replace with: Find = ^d HYPERLINK Replace = <HL>^&<\HL> Press Alt-F9 again when you're done. No macros required.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Quote:
-------------------------- Edit --Never mind. It does work when I enter the style formatting for the hyperlink in the FIND box. The resulting HL bits are searchable later on, so that does solve the issue. Thanks! |
#4
|
|||
|
|||
I created a macro that finds the hyperlink formatting style, then backs out of the hyperlink coding string, types the (HL) bit, then looks for the next unformatted space (since some of the hyperlinks contain multiple words). That part works, but I don't have the coding experience to get the macro to loop until the end of the document is reached.
|
#5
|
||||
|
||||
I gave you two Find/Replace options, so why are you persisting with a macro? In any event, the macro recorder would capture the required Find/Replace code.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Quote:
In any case, I'm still interested in finding out how to loop that macro, at least for future ref. Thanks. |
#7
|
||||
|
||||
If you record the Find/Replace macro using either of the suggested approaches, you will see there is no need for a loop.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Yes, in the example above. I'm just interested in finding out how to loop a macro anyway, as I may have use for this for other things. I just thought of asking since the issue came up.
|
#9
|
||||
|
||||
There are many examples of VBA loops on this site. For one working with hyperlinks, see: https://www.msofficeforums.com/word-...html#post90568
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
Thanks for your help on this.
|
Tags |
conversion, hyperlink, search and replace |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search and replace | hernans | Word VBA | 5 | 07-02-2018 07:01 PM |
Search and Replace puzzle | grantworth | Word | 3 | 04-07-2015 05:32 AM |
search and replace | dirkoo | Word VBA | 2 | 08-14-2013 11:25 AM |
Search and Replace - Clear Search box | JostClan | Word | 1 | 05-04-2010 08:46 PM |