When a "my_protocol://..." link is clicked in Internet Explorer, my
application is launched and it is passed the whole URL as a parameter. My
application is a simple windows executable file.
The question has to do with what should I do to have the URLs of this new
protocol recognized in MS Word, Outlook and other programs. Ideally I'd like
these links to be AUTOMATICALLY recognized, highlighted and clickable in
word and other documents, like the "maillto://..." and the "http://..." text
does
Let me know when you find a solution.
Incidentally I have been asking the exact same thing about a month ago
(thread "Special handling required to make URL protocols "clickable" in
Outlook?").
I'm still completely in the dark with this and am almost ready to
believe that MS simply hardcoded the clickable protocols... :(
Cheers,
Oliver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <birb...@kagi.com>
Microsoft Most Valuable Professional
MVP J# for 2004, 2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime (Delphi & ActiveX: VB, PowerPoint, .NET)
+ Plugs (InterProcess/Internet communication)
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
........................................................................
CASE_ID_NUM: SRQ050603600184
MESSAGE:
**********************************************************************
This is an email from Microsoft about your support incident.
When replying to this address:
+ It helps us if you do not include the original message
+ Please keep the case number (SRxxxx) in the subject line
Thank you
Microsoft Product Support Services
******************* The message from Microsoft follows ****************
Dear Mr. Birbilis,
Unfortunately the Hyperlink recognition in Office - so that auto format
automatically transforms the entered text into a hyperlink - is hard coded.
Therefore you can't add new protocols to the recognition.
The following hyperlink patterns are recognized by Microsoft Office
(the listing might be incomplete):
1. if first word of a hyperlink is
- "www" (e.g. www.microsoft.com)
- "home" (e.g. home.microsoft.com)
- "ftp" (e.g. ftp.microsoft.com)
2. If hyperlink starts with one of the following expressions followed by
"://"
- http
- https
- ftp
- afs
- gopher
- prospero
- telnet
- wais
- file
- pnm
- mms
3. if hyperlink starts with one of the following expressions followed by ":"
- url
- mailto
- cid
- news
- nntp
- rlogin
- msn
- outlook
- Tn3270
What would be possible is to run a macro that changes all strings which
contain foe example "note:" to a hyperlink. I have added an example for
Microsoft Excel to show how such a macro would look like.
Sub SetHypLink()
For Each c In ActiveSheet.UsedRange
celltext = c.Value
If InStr(1, celltext, "note:") Then
c.Hyperlinks.Add Anchor:=Range(c.Address), Address:=celltext _
, TextToDisplay:=celltext
End If
Next c
End Sub
Kind regards,
Eugen Svierak
Specialist Support Engineer
EMEA Global Technical Support Centre
Microsoft Product Support Services
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN
RISK. Microsoft provides this macro code "as is" without warranty of any
kind, either express or implied, including but not limited to the implied
warranties of merchantability and/or fitness for a particular purpose.
> This is the answer I got from MS regarding this issue (using on of my
> MSDN universal support questions - 3 days time to answer, not bad):
Thanks for taking this up! :)
> Unfortunately the Hyperlink recognition in Office - so that auto
> format automatically transforms the entered text into a hyperlink -
> is hard coded. Therefore you can't add new protocols to the
> recognition.
>
> The following hyperlink patterns are recognized by Microsoft Office
> (the listing might be incomplete):
>
<.snip.>
> 3. if hyperlink starts with one of the following expressions followed
> by ":"
> - url
I wonder, what is this? AFAICT "url:" is not associated with anything
by default. Is this an Office-internal protocol? Could this maybe be
(ab-)used for our purposes? E.g. by writing something like:
url:myprotocol://whatever
I'd just try it but as it is I'm currently on a machine that doesn't
have any MSOffice components installed... I'll try tomorrow. Just
thinking aloud for now...
Cheers and thanks again for stepping in,
Oliver
Outlook however only recognizes about half of the patterns.
Regrettably, url: is not one of them... :(
Here are my findings:
> The following hyperlink patterns are recognized by Microsoft Office
> (the listing might be incomplete):
>
> 1. if first word of a hyperlink is
> - "www" (e.g. www.microsoft.com)
> - "ftp" (e.g. ftp.microsoft.com)
Outlook, Word, Excel: Yes
> - "home" (e.g. home.microsoft.com)
Word, Excel: Yes (if there are at least two dots in the string
following "home", e.g. home.blah.com )
Outlook: No
> 2. If hyperlink starts with one of the following expressions followed
> by "://"
> - http
> - https
> - ftp
> - gopher
> - prospero
> - telnet
> - wais
> - file
Word, Excel: Yes (when followed by a string, e.g. ftp://blah )
Outlook: Yes (as of the first slash character, e.g. http:/ )
> - afs
> - pnm
> - mms
Word, Excel: Yes (when followed by a string, e.g. afs://blah )
Outlook: No
> 3. if hyperlink starts with one of the following expressions followed
> by ":"
> - mailto
> - news
> - nntp
> - outlook
Outlook, Word, Excel: Yes (when followed by a string, e.g. mailto:blah)
> - url
> - cid
> - rlogin
> - msn
> - Tn3270
Word, Excel: Yes (when followed by a string, e.g. url:blah)
Outlook: No
I tested with Word/Excel/Outlook 2000 and Outlook 2003.
Cheers,
Oliver