Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
tjtjjtjt
 
Posts: n/a
Default Reason for collapse?

A few days ago I posted this code to try and get a version of it that would
work on Selected text only.

Sub UnlinkHyperlinks()
Dim nHL As Long
For nHL = 1 To ActiveDocument.Hyperlinks.Count
ActiveDocument.Hyperlinks(1).Delete
Next nHL
End Sub

I had tried just changing AcitiveDocument to Selection, but I always got
Runtime error: 5941.
Several people tried to help me find out what was wrong. It turns out, the
code only fails when the selected text start at the beginning of the
hyperlink.
Does anyone have an idea as to why this would happen?

Thanks,

--
tj
 
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
my document closes with no reason in word 2003 Frognostik Microsoft Word Help 0 May 10th 05 10:51 AM
Type "=rand()" in word2003 then press enter.Give me the reason. Sujit Mohanty Microsoft Word Help 2 May 6th 05 03:30 PM
Revision tracking by reason EdGabb Microsoft Word Help 10 March 22nd 05 03:25 AM
How do I find the reason for error in top margin on new page? Reliz Page Layout 1 December 30th 04 07:10 PM


All times are GMT +1. The time now is 05:02 AM.

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

About Us

"It's about Microsoft Word"