Need troubleshooting help with 3 lines of VBA code

P

padshall

This crashes Word 2007 even though it works with previous versions. Current
doc is just standing for the name of the currently active document.

Sub FollowLink()
Selection.Hyperlinks(1).Follow
Documents("current.doc").Close
End Sub

Any one got any idea why?
 
S

Shauna Kelly

Hi

It works for me. If you step through the code, on which line do you get the
error? What is the error message? And where is the insertion point when you
begin to run the code?

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
Top