Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-09-2019, 08:12 AM
Ambreville Ambreville is offline Flagging Hyperlinks using search & replace? Windows 10 Flagging Hyperlinks using search & replace? Office 2013
Novice
Flagging Hyperlinks using search & replace?
 
Join Date: May 2019
Posts: 6
Ambreville is on a distinguished road
Default 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!!
Reply With Quote
  #2  
Old 05-09-2019, 02:35 PM
macropod's Avatar
macropod macropod is offline Flagging Hyperlinks using search & replace? Windows 7 64bit Flagging Hyperlinks using search & replace? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 05-09-2019, 03:09 PM
Ambreville Ambreville is offline Flagging Hyperlinks using search &amp; replace? Windows 10 Flagging Hyperlinks using search &amp; replace? Office 2013
Novice
Flagging Hyperlinks using search &amp; replace?
 
Join Date: May 2019
Posts: 6
Ambreville is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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.
This doesn't seem to work. If I don't put anything in the Find box, then the search cannot occur.

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

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!
Reply With Quote
  #4  
Old 05-09-2019, 03:18 PM
Ambreville Ambreville is offline Flagging Hyperlinks using search &amp; replace? Windows 10 Flagging Hyperlinks using search &amp; replace? Office 2013
Novice
Flagging Hyperlinks using search &amp; replace?
 
Join Date: May 2019
Posts: 6
Ambreville is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 05-09-2019, 03:50 PM
macropod's Avatar
macropod macropod is offline Flagging Hyperlinks using search &amp; replace? Windows 7 64bit Flagging Hyperlinks using search &amp; replace? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #6  
Old 05-09-2019, 04:13 PM
Ambreville Ambreville is offline Flagging Hyperlinks using search &amp; replace? Windows 10 Flagging Hyperlinks using search &amp; replace? Office 2013
Novice
Flagging Hyperlinks using search &amp; replace?
 
Join Date: May 2019
Posts: 6
Ambreville is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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.
I appended the "edit" to my first response to you *after* I posted the bit about the macro.

In any case, I'm still interested in finding out how to loop that macro, at least for future ref. Thanks.
Reply With Quote
  #7  
Old 05-09-2019, 04:17 PM
macropod's Avatar
macropod macropod is offline Flagging Hyperlinks using search &amp; replace? Windows 7 64bit Flagging Hyperlinks using search &amp; replace? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #8  
Old 05-09-2019, 04:24 PM
Ambreville Ambreville is offline Flagging Hyperlinks using search &amp; replace? Windows 10 Flagging Hyperlinks using search &amp; replace? Office 2013
Novice
Flagging Hyperlinks using search &amp; replace?
 
Join Date: May 2019
Posts: 6
Ambreville is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
If you record the Find/Replace macro using either of the suggested approaches, you will see there is no need for a loop.
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.
Reply With Quote
  #9  
Old 05-09-2019, 04:33 PM
macropod's Avatar
macropod macropod is offline Flagging Hyperlinks using search &amp; replace? Windows 7 64bit Flagging Hyperlinks using search &amp; replace? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #10  
Old 05-09-2019, 04:39 PM
Ambreville Ambreville is offline Flagging Hyperlinks using search &amp; replace? Windows 10 Flagging Hyperlinks using search &amp; replace? Office 2013
Novice
Flagging Hyperlinks using search &amp; replace?
 
Join Date: May 2019
Posts: 6
Ambreville is on a distinguished road
Default

Thanks for your help on this.
Reply With Quote
Reply

Tags
conversion, hyperlink, search and replace

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Flagging Hyperlinks using search &amp; replace? 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
Flagging Hyperlinks using search &amp; replace? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft