How to click open a hyperlink on a  word document  without pressing the Cntrl

lianne143
lianne143 used Ask the Experts™
on
Hi
I have inserted 10 different hyperlinks on a Microsoft word document.

The address for each file is located on our file server and they contain our organization policies.

I am going to copy this word file to all the staff desktops.

When users open this word file I would like them to click the links straight away without pressing the Cntrl

Is there any way we can program this on this word file this way.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Go to Word Options - Advanced - Editing Options. Uncheck "Use Ctrl + Click to follow hyperlink."

Paul
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi Lianne,
I don't know of a way to do it for a document. You can do it as an option in Word via File>Options>Advanced:

Word follow link
Un-tick the Use CTRL + Click to follow hyperlink box, which will apply to all links in all docs. Regards, Joe
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Update: When I hit the Submit button I saw Paul's post, which has the same method that I posted, but it's important to keep in mind that this will not affect your document(s). This is a Word option, not a document option. What this means is that copying the Word file to all the staff desktops will not result in what you want unless the users change their Word options (as Paul and I posted).

So the answer to your question, "Is there any way we can program this on this word file this way", is NO, as far as I know, although I could be wrong about that. Regards, Joe
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Thanks Joe

I am aware of above  settings as posted , but thinking if these is is way to lock this settings on this particular word file.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Yes, that would be a nice, document-based feature. I'll do some research on it to see if anything is out there...off the top of my head I'm not aware of it, but maybe it's possible...I'll let you know one way or the other if I unearth anything.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi Lianne,
My research came up empty...no way to do it in Word that I could find. But here's an idea for you. Convert the Word doc to a PDF (many ways to do that...an easy one is Save As in Word to PDF). PDF editors/readers/viewers allow a simple click (not Ctrl+Click) to access a link. Regards, Joe

Author

Commented:
Thank you so much Joe

Author

Commented:
I tried this method as well, but whenever I click the link, it asks security questions, not sure if I will be able to stop this pop up message.
I will post the screenshot tomorrow.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Yes, I know what you mean...it is this:

pdf link warning
But since the addresses for all 10 hyperlinks are located on your file server, the users would have to click the Allow button only once and make sure that the "Remember this action..." box is ticked, which it already should be, since it's the default. I think that's preferable to having to (1) Ctrl+Click on every link or (2) change the option on every user's installation of Word.
If you don't mind saving your document as a Macro-Enabled document, you can try this macro that will uncheck that box upon opening the document:

Sub AutoOpen()
'This macro will run automatically when document is opened
'and will uncheck "Use Ctrl + Click to follow hyperlink."
'Document must be saved as a Macro-Enabled document

    Options.CtrlClickHyperlinkToOpen = False
    
End Sub

Open in new window

Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi Flyster,
Very clever idea! Tested here...works a charm! The only downside is that it's still not a document-centric fix, of course, since it seems that Word doesn't support that. Your macro changes the option in Word so that the user will have that feature set for all future file opens...may or may not be desirable. In any case, great idea! Regards, Joe
@Joe. Thanks Joe. You can also have a AutoClose macro that will be change that value back to true!
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
> You can also have a AutoClose macro that will be change that value back to true!

Very nice! I was wondering about that...I'm sure it's obvious that I'm not a Word macro expert. :)

Is there a way to query what its current value is so that AutoClose can set it to the value that it was when AutoOpen ran?
@Joe. Yes. You declare a public variable. This seems to work:

Option Explicit
Public clkhyper As String

Sub AutoOpen()
'This macro will run automatically when document is opened
'and will uncheck "Use Ctrl + Click to follow hyperlink."
'Document must be saved as a Macro-Enabled document

clkhyper = Options.CtrlClickHyperlinkToOpen

    Options.CtrlClickHyperlinkToOpen = False
    
End Sub

Sub AutoClose()

    Options.CtrlClickHyperlinkToOpen = clkhyper
    
End Sub

Open in new window

Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi Paul,

When I enter the macro, I get this:

word macro error
When I hit the Debug button, it shows this:

word macro debug
What's really interesting, though, is that it works perfectly after that! I don't know why it's throwing the error when it works fine. Any ideas?

In any case, very good stuff! Regards, Joe
The error occurred because clkhyper is defined in the AutoOpen macro. I'm guessing you had the document opened when you pasted the new code in. Closing the document caused the AutoClose macro to run, and it had no idea what clkhyper was!
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
> I'm guessing you had the document opened when you pasted the new code in.

Ah, excellent guess! :) Is there any other way to paste new code into a specific document's macros without having the document open?

> Closing the document caused the AutoClose macro to run, and it had no idea what clkhyper was!

Got it!
Is there any other way to paste new code into a specific document's macros without having the document open?

If there is, it's beyond my expertise. My knowledge of VBA is somewhat limited!
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
My knowledge of VBA is somewhat limited!
Maybe...but it's a lot better than mine. :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial