0

I have excel sheet with hyperlinks to my local intranet network files.

The address of hyperlinks is like this: http://maxapp.local:90/allhelipa.doc

The problem:

If there is already an opened word document and then I clicked hyperlink (Word Document on my local intranet), The later file is not opened automatically and I have to click on the flashing taskbar button to open the cited second file.

This issue occurs only with Microsoft word documents found on my local intranet.

If there no open document and I clicked on any word hyperlink, It opens normally without any issue.

I tried to put the same word documents on my work shared folder and set hyperlinks address to the respective location.

There is no issue to open an additional hyperlink (Word Document) and it brought to front automatically without I have to click on the flashing taskbar button.

Is there any option to apply or any registry setting to use?

1 Answer 1

1

I cannot reproduce your problem (Office 365), so I cannot test the solution I propose...

Please, use this event in Word normal.dotm, if your problem is related to Word documents type:

Private Sub Document_Open() If Application.Documents.Count > 1 Then AppActivate Application.ActiveWindow.Caption End If End Sub 

Theoretically, it should activate Word application when a document is open.

If it does not work in that way, API call (probably, SetForegroundWindow) should make the job. I tried avoiding API, if this simple solution works for you...

I tested it from Excel, using the next code:

Sub testActivateWord() Dim objWd As Object Set objWd = GetObject(, "Word.Application") AppActivate objWd.ActiveWindow.Caption Set objWd = Nothing End Sub 

and it does the job...

It needs error handling for the case of no Word session already open, but this is simple. I mean, in Excel. I Word, Application is Application for all cases. :)

8
  • 1
    I tried the first solution, But I got (Run-time error '5': Invalid procedure call or argument) at this line AppActivate Application.ActiveWindow.Caption, I have put the code on Normal--->ThisDocument, I am using office 2016. Commented Jan 12, 2023 at 11:39
  • @Waleed If no Word session open, no ActiveWindow exists... Please, try the updated code. It previously check if there are more than 1 document (normal.dotm should be the first...). If it still does not work, may I connect trough AnyDesk? I cannot test it on my environment... Commented Jan 12, 2023 at 12:19
  • Sorry for my late reply. Unfortunately IT on my work is very restricted and they will not allow this kind of connection. Commented Jan 13, 2023 at 6:02
  • Beside your first option (after update) ,also I added your second code to my excel workbook on FollowHyperlink event, then sometimes no issue to open multi hyperlinks and sometimes the issue as it is. Commented Jan 13, 2023 at 6:14
  • Also, I remembered that, there was a security warning if I opened any word file from my local intranet, I have used a registry setting to suppress this message , I applied this setting from a long time ago (Up voted for your help) Commented Jan 13, 2023 at 6:36

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.