Follow hyperlink to word

humph

Registered User.
Local time
Yesterday, 18:22
Joined
Sep 7, 2006
Messages
69
I have created a hypelink to a text box and it is working thanks to this forum for most of the code. Problem - file opens in word OK but word does not become the main focus on the screen and it is listed on the bottom of the screen to be clicked on to display the word document

Any ideas please
 
Timing issue

Thanks for the help Moniker

Firstly I am opening word and have changed the code to

AppActivate "Microsoft Word"
SendKeys ("%R")

Am having difficulty knowing where to insert it. When I click the text box hyperlink I have tried it both in the on click code and the lost focus but as word takes time to open it may not be open when the code runs and is therefore not opened. I assume that is the reason.

Have tried in the on click

Private Sub Text1003_Click()
On Error GoTo Text1003_Err

Application.FollowHyperlink Text1003
AppActivate "Microsoft Word"
SendKeys ("%R")
Text1003_Exit:
Exit Sub

Text1003_Err:
If Error$ = "Invalid use of Null" Then MsgBox "It's only usefull to click here once you have added a file.", vbOKOnly
Resume Text1003_Exit
If Error$ <> "Invalid use of Null" Then MsgBox Error$
Resume Text1003_Exit

End Sub

AND

Private Sub Text1003_LostFocus()
AppActivate "Microsoft Word"
SendKeys ("%R")
End Sub

Thanks for your help and will do re the feedback scales
 

Users who are viewing this thread

Back
Top Bottom