Reply
 
Thread Tools Display Modes
  #1   Report Post  
Al Bedo
 
Posts: n/a
Default Can I force long hyperlinks to break when using justify?

Hi

I am writing a piece of justified text with hyperlinks inserted as
references (and yes, these must be fully visible within the text itself).
However, long hyperlinks are put on lines of their own, and justifying means
that if there are a few words on the line it was originally from, then these
get spaced out to ridiculous proportions.

So, is there any way to force long hyperlinks to break when using justify?

Thanks.


  #2   Report Post  
WordBanter AI WordBanter AI is offline
Word Super Guru
 
Posts: 1,200
Thumbs up Answer: Can I force long hyperlinks to break when using justify?

How to force long hyperlinks to break in Microsoft Word

1. Select the hyperlink that you want to break.
  1. Right-click on the hyperlink and select "Edit Hyperlink" from the context menu.
2. In the "Edit Hyperlink" dialog box, click on the "ScreenTip" button.
3. In the "Set Hyperlink ScreenTip" dialog box, add a space or a hyphen where you want the hyperlink to break.
4. Click "OK" to close the "Set Hyperlink ScreenTip" dialog box.
5. Click "OK" to close the "Edit Hyperlink" dialog box.

By adding a space or a hyphen in the hyperlink's ScreenTip, you are telling Word to break the hyperlink at that point when it is justified. This will prevent the long hyperlink from taking up an entire line and causing the surrounding text to be spaced out too much.

PHP Code:
// Sample macro code
Sub BreakHyperlink()
    
' Select the hyperlink to break
    Selection.Hyperlinks(1).Range.Select
    
    ' 
Get the hyperlink address
    Dim address 
As String
    address 
Selection.Hyperlinks(1).Address
    
    
' Replace the last slash with a space
    Dim breakPoint As Integer
    breakPoint = InStrRev(address, "/")
    address = Left(address, breakPoint - 1) & " " & Right(address, Len(address) - breakPoint)
    
    ' 
Update the hyperlink address and ScreenTip
    Selection
.Hyperlinks(1).Address address
    Selection
.Hyperlinks(1).ScreenTip address
    
    
' Deselect the hyperlink
    Selection.Collapse
End Sub 
If you need to break multiple hyperlinks at once, you can use a macro like the one above. This macro replaces the last slash in the hyperlink address with a space, effectively breaking the hyperlink at that point. You can modify the macro to break the hyperlink at a different character if needed.
__________________
I am not human. I am a Microsoft Word Wizard
  #4   Report Post  
Bob Buckland ?:-\)
 
Posts: n/a
Default

Hi Al,

Are you using the justify button in regular text
or the [x] Fit text feature from Table=Properties=Cell=Options.
The latter one can do some really odd things.

Are you intentionally starting the hyperlinks as a new line
or paragraph?

Are you allowing Word to do automatic hyphenation
(Tools=Language) so that it has more places it can break
up Words to minimize the 'space spread' when using justified text?

Are you working in a view other than Print Layout?

For the hyperlinks it can depend on what is visible for the hyperlink and
that does not have to be the same as where the link takes
you when used.

For example if I paste your question below into Word and select
two lines worth of text then use ctrl+K to create a hyperlink
then the display text will wrap normally as it has spaces and
is text even though the underlying link is a URL without spaces.

If, however, I'm using the URL as the display, and URLs generally
do not have spaces in them, then Word only has one 'word' to deal
with if the font you're using is a decorative (symbols that look
like letters) one. However, even a long URL such as this one

http://support.corel.com/scripts/rig...FnZT0 x&p_li=

(may break in your newsreader into multiple paragraphs) wraps in
Word when placed inside a sentence (i.e. pasted between Words).

can have the display text for that hyperlink be
"Microsoft Word Document (DOC) Technical Notes"
the title of that web page.

=========
"Al Bedo" Al wrote in message ...
Hi

I am writing a piece of justified text with hyperlinks inserted as
references (and yes, these must be fully visible within the text itself).
However, long hyperlinks are put on lines of their own, and justifying means
that if there are a few words on the line it was originally from, then these
get spaced out to ridiculous proportions.

So, is there any way to force long hyperlinks to break when using justify?

Thanks.
--
Bob Buckland ?:-)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*



  #5   Report Post  
Al Bedo
 
Posts: n/a
Default

Hi

Yep, ALT-8203 was just what I needed - many thanks. It would be nice
perhaps if future versions of Word checked for http: or www. in the display
text of a hyperlink and added these automatically ?!?

Thanks again.

"Suzanne S. Barnhill" wrote:

You can insert a No Width Optional Break at the appropriate point (*before*
a forward slash is the recommended point). See
http://word.mvps.org/FAQs/Formatting/NoWidthSpace.htm (note that the break
Word inserts from the Special Characters tab of Insert Symbol is 200C rather
than 200B as Klaus advises). Also note that is no
longer valid.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site:
http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Al Bedo" Al wrote in message
...
Hi

I am writing a piece of justified text with hyperlinks inserted as
references (and yes, these must be fully visible within the text itself).
However, long hyperlinks are put on lines of their own, and justifying

means
that if there are a few words on the line it was originally from, then

these
get spaced out to ridiculous proportions.

So, is there any way to force long hyperlinks to break when using justify?

Thanks.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot delete a Section Break JMMerrick Microsoft Word Help 1 March 15th 05 12:40 AM
section break in master document Frank Drost Formatting Long Documents 1 March 3rd 05 03:58 PM
section break continuous turns into page break Morgan Page Layout 4 February 24th 05 08:55 PM
Using Hyperlinks in Mail Merge IF...THEN...ELSE Statements Mark V Mailmerge 8 November 30th 04 02:31 PM
Finding/removing an "obascure" manual page break Fred Holmes Tables 2 November 5th 04 07:57 PM


All times are GMT +1. The time now is 09:36 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"