Hyperlinks

Y

yonido

We are working on a new version of the project, and we need to handle
a word hyperlink's click event - to run code when the user hits a link
in a word document.

Unfortunately, the object model does not provide such an event. it
does, however - provide application.DocumentOpen which is triggered,
but when the event is triggered, the document is already open. we dont
want the link to be opened, just to get the event. we also tried to
hide the link's window, but you can still see it for a second when
clicking the link.

So I tried to do the following: register a file type - *.mylink and
associate it to a simple EXE program, named LinkCapturer. whenever a
..mylink file is opened, the LinkCapturer sends a windows message to
our process, informing the link click. The links in the word file will
be targeted to theses .mylink files. The idea WORKS, but problem is
that when clicking these hyperlinks, we get a security warning message
- which cannot be disabled. this is a known issue - refer:
http://support.microsoft.com/?scid=kb;en-us;291912.
Note that other types - such as .doc / .mp3 / .ppt are opened with no
warning. Ive searched the registry to find where word stores the
'trusted types' with no luck.

My last attempt is to register a protocol prefix, like "http://" or
"ftp://" or "file://" - named "mylink://" which the file name will
follow, and link to this address ("mylink://myfile.doc"). The securiry
warning pops in this situation too.
note that targeting 'known' addresses such as "http://blah/some.doc"
opens with no warning.

I've pretty much ran out of ideas, and I'll appreciate any help / way
to catch the link-click event / avoiding this security message.

Thanks.
 

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