Word 2000 Hyperlink Error: Fields are nested too deeply

V

VictorReinhart

Hi,
I solved what seems to be a bug in Word 2000. This line of code:

ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range _
, Address:=ls_ltr$

will sometimes cause a message to appear:

Microsoft Word
Fields are nested too deeply

Despite the the error (which opens a modal window), the command does
create the hyperlink. However, the error message is annoying, and
after it happens once, then for each subsequent hyperlink, the error
happens again! In my test case, the error message pops up 4 times in
a row.

The fix was to add this line of code above it:
Response = DoEvents()

Regards,

VictorReinhart
 
J

Jezebel

Not sure what's causing your problem, but trapping the error might be a
better workaround. Using DoEvents is risky unless you switch off the user
interface. DoEvents checks what's in the computer's message queue --
mouseclicks, keypresses, etc -- so there's a danger that the user will
initiate some action (like changing the selection or even closing the
document) that will interfere with what your macro code is trying to do.
 
V

VictorReinhart

Hi,
My solution is not reliable -- sometimes the problem still happens.

How can I trap the error? The code already begins with:

On Error Resume Next ' Don't just abend!

The error pops open a modal error message, in a rectangular box with
yellow background, without the paperclip.

Thank you

Victor Reinhart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top