A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Hyperlinks is becoming non-clickable in RTFBody format



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 25th 09, 10:13 AM posted to microsoft.public.outlook.program_vba
paresh
external usenet poster
 
Posts: 66
Default Hyperlinks is becoming non-clickable in RTFBody format

Hi,

I have written one add-in which replaces [a-zA-z]#[0-9] or
[a-zA-z]#[0-9]#[0-9] with the hyperlinks. It is working fine(attached portion
of code). I found the two problems.

1. The hyperlink (in format of "http://mylink/Q/") is getting converted
into clickable link if I use objSafeMail.Body instead of objSafeMail.RTFBody
in my code but usage of objSafeMail.Body converts mail format to plain text.

2. If I use objSafeMail.RTFBody then hyperlink is becoming non-clickable.

Could any one suggest me if in Option#1 (while using objSafeMail.Body) it is
possible to persist email format as it is OR in Option#2 is it possible to
make replaced hyperlink to clickable,

Code:

Private Sub objMailItem_Send(Cancel As Boolean)
Const Link = "http://mylink/Q/"
Const REQUEST_PATTERN = "([a-zA-Z]+)(\#[0-9]+){1,2}(?!\#)\b"
Set oRE = CreateObject("VBScript.Regexp")
With oRE
.IgnoreCase = True
.Global = True
.MultiLine = True
.Pattern = REQUEST_PATTERN
End With
objMailItem.BodyFormat = olFormatHTML
objMailItem.Save
Dim objSafeMail As Redemption.SafeMailItem
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objMailItem
Set oMatches = oRE.Execute(objSafeMail.Body)
objSafeMail.RTFBody = oRE.Replace(objSafeMail.RTFBody, Link &
"$1/$&")
objSafeMail.Save

For Each omatch In oMatches
objSafeMail.RTFBody = Replace(objSafeMail.RTFBody, "/" &
omatch.SubMatches(0) & "#", "/")
objSafeMail.Save
Next
End Sub

Thanks.
Ads
  #2  
Old April 27th 09, 03:15 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Hyperlinks is becoming non-clickable in RTFBody format

And if you look at the RTF body, what exactly do you see?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
Hi,

I have written one add-in which replaces [a-zA-z]#[0-9] or
[a-zA-z]#[0-9]#[0-9] with the hyperlinks. It is working fine(attached
portion
of code). I found the two problems.

1. The hyperlink (in format of "http://mylink/Q/") is getting converted
into clickable link if I use objSafeMail.Body instead of
objSafeMail.RTFBody
in my code but usage of objSafeMail.Body converts mail format to plain
text.

2. If I use objSafeMail.RTFBody then hyperlink is becoming
non-clickable.

Could any one suggest me if in Option#1 (while using objSafeMail.Body) it
is
possible to persist email format as it is OR in Option#2 is it possible to
make replaced hyperlink to clickable,

Code:

Private Sub objMailItem_Send(Cancel As Boolean)
Const Link = "http://mylink/Q/"
Const REQUEST_PATTERN = "([a-zA-Z]+)(\#[0-9]+){1,2}(?!\#)\b"
Set oRE = CreateObject("VBScript.Regexp")
With oRE
.IgnoreCase = True
.Global = True
.MultiLine = True
.Pattern = REQUEST_PATTERN
End With
objMailItem.BodyFormat = olFormatHTML
objMailItem.Save
Dim objSafeMail As Redemption.SafeMailItem
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objMailItem
Set oMatches = oRE.Execute(objSafeMail.Body)
objSafeMail.RTFBody = oRE.Replace(objSafeMail.RTFBody, Link &
"$1/$&")
objSafeMail.Save

For Each omatch In oMatches
objSafeMail.RTFBody = Replace(objSafeMail.RTFBody, "/" &
omatch.SubMatches(0) & "#", "/")
objSafeMail.Save
Next
End Sub

Thanks.



  #3  
Old April 27th 09, 03:32 PM posted to microsoft.public.outlook.program_vba
paresh
external usenet poster
 
Posts: 66
Default Hyperlinks is becoming non-clickable in RTFBody format

Dmitry, I could see the complete expected contents. Suppose my email RTFbody
contains "This is a test#123." Then my Add-in converts it to "This is
http://mylink/Q/test/123." but the hyperlink is staying non-clickable. If I
do the same thing using email body (not RTFBody) then link get converted into
clickable link but format is getting changed to plain text. :-(

Thanks,
Paresh

"Dmitry Streblechenko" wrote:

And if you look at the RTF body, what exactly do you see?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
Hi,

I have written one add-in which replaces [a-zA-z]#[0-9] or
[a-zA-z]#[0-9]#[0-9] with the hyperlinks. It is working fine(attached
portion
of code). I found the two problems.

1. The hyperlink (in format of "http://mylink/Q/") is getting converted
into clickable link if I use objSafeMail.Body instead of
objSafeMail.RTFBody
in my code but usage of objSafeMail.Body converts mail format to plain
text.

2. If I use objSafeMail.RTFBody then hyperlink is becoming
non-clickable.

Could any one suggest me if in Option#1 (while using objSafeMail.Body) it
is
possible to persist email format as it is OR in Option#2 is it possible to
make replaced hyperlink to clickable,

Code:

Private Sub objMailItem_Send(Cancel As Boolean)
Const Link = "http://mylink/Q/"
Const REQUEST_PATTERN = "([a-zA-Z]+)(\#[0-9]+){1,2}(?!\#)\b"
Set oRE = CreateObject("VBScript.Regexp")
With oRE
.IgnoreCase = True
.Global = True
.MultiLine = True
.Pattern = REQUEST_PATTERN
End With
objMailItem.BodyFormat = olFormatHTML
objMailItem.Save
Dim objSafeMail As Redemption.SafeMailItem
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objMailItem
Set oMatches = oRE.Execute(objSafeMail.Body)
objSafeMail.RTFBody = oRE.Replace(objSafeMail.RTFBody, Link &
"$1/$&")
objSafeMail.Save

For Each omatch In oMatches
objSafeMail.RTFBody = Replace(objSafeMail.RTFBody, "/" &
omatch.SubMatches(0) & "#", "/")
objSafeMail.Save
Next
End Sub

Thanks.




  #4  
Old April 28th 09, 11:00 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Hyperlinks is becoming non-clickable in RTFBody format

Why do you expect it to become a hyperlink? You need to explicitly use the
appropriate RTF keywords to mark soem string as a hyperlink.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
Dmitry, I could see the complete expected contents. Suppose my email
RTFbody
contains "This is a test#123." Then my Add-in converts it to "This is
http://mylink/Q/test/123." but the hyperlink is staying non-clickable. If
I
do the same thing using email body (not RTFBody) then link get converted
into
clickable link but format is getting changed to plain text. :-(

Thanks,
Paresh

"Dmitry Streblechenko" wrote:

And if you look at the RTF body, what exactly do you see?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
Hi,

I have written one add-in which replaces [a-zA-z]#[0-9] or
[a-zA-z]#[0-9]#[0-9] with the hyperlinks. It is working fine(attached
portion
of code). I found the two problems.

1. The hyperlink (in format of "http://mylink/Q/") is getting
converted
into clickable link if I use objSafeMail.Body instead of
objSafeMail.RTFBody
in my code but usage of objSafeMail.Body converts mail format to plain
text.

2. If I use objSafeMail.RTFBody then hyperlink is becoming
non-clickable.

Could any one suggest me if in Option#1 (while using objSafeMail.Body)
it
is
possible to persist email format as it is OR in Option#2 is it possible
to
make replaced hyperlink to clickable,

Code:

Private Sub objMailItem_Send(Cancel As Boolean)
Const Link = "http://mylink/Q/"
Const REQUEST_PATTERN = "([a-zA-Z]+)(\#[0-9]+){1,2}(?!\#)\b"
Set oRE = CreateObject("VBScript.Regexp")
With oRE
.IgnoreCase = True
.Global = True
.MultiLine = True
.Pattern = REQUEST_PATTERN
End With
objMailItem.BodyFormat = olFormatHTML
objMailItem.Save
Dim objSafeMail As Redemption.SafeMailItem
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objMailItem
Set oMatches = oRE.Execute(objSafeMail.Body)
objSafeMail.RTFBody = oRE.Replace(objSafeMail.RTFBody, Link
&
"$1/$&")
objSafeMail.Save

For Each omatch In oMatches
objSafeMail.RTFBody = Replace(objSafeMail.RTFBody, "/" &
omatch.SubMatches(0) & "#", "/")
objSafeMail.Save
Next
End Sub

Thanks.






  #5  
Old April 29th 09, 06:58 AM posted to microsoft.public.outlook.program_vba
paresh
external usenet poster
 
Posts: 66
Default Hyperlinks is becoming non-clickable in RTFBody format

I thought it is link and as it getting coverted to clickable link while using
..Body so it should with .RTFBody as well. :-)

Could you tell me what are the RT Keywords and how could I use it to make it
clickable hyper link. Example would be much helpful.

Thanks,
Paresh

"Dmitry Streblechenko" wrote:

Why do you expect it to become a hyperlink? You need to explicitly use the
appropriate RTF keywords to mark soem string as a hyperlink.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
Dmitry, I could see the complete expected contents. Suppose my email
RTFbody
contains "This is a test#123." Then my Add-in converts it to "This is
http://mylink/Q/test/123." but the hyperlink is staying non-clickable. If
I
do the same thing using email body (not RTFBody) then link get converted
into
clickable link but format is getting changed to plain text. :-(

Thanks,
Paresh

"Dmitry Streblechenko" wrote:

And if you look at the RTF body, what exactly do you see?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
Hi,

I have written one add-in which replaces [a-zA-z]#[0-9] or
[a-zA-z]#[0-9]#[0-9] with the hyperlinks. It is working fine(attached
portion
of code). I found the two problems.

1. The hyperlink (in format of "http://mylink/Q/") is getting
converted
into clickable link if I use objSafeMail.Body instead of
objSafeMail.RTFBody
in my code but usage of objSafeMail.Body converts mail format to plain
text.

2. If I use objSafeMail.RTFBody then hyperlink is becoming
non-clickable.

Could any one suggest me if in Option#1 (while using objSafeMail.Body)
it
is
possible to persist email format as it is OR in Option#2 is it possible
to
make replaced hyperlink to clickable,

Code:

Private Sub objMailItem_Send(Cancel As Boolean)
Const Link = "http://mylink/Q/"
Const REQUEST_PATTERN = "([a-zA-Z]+)(\#[0-9]+){1,2}(?!\#)\b"
Set oRE = CreateObject("VBScript.Regexp")
With oRE
.IgnoreCase = True
.Global = True
.MultiLine = True
.Pattern = REQUEST_PATTERN
End With
objMailItem.BodyFormat = olFormatHTML
objMailItem.Save
Dim objSafeMail As Redemption.SafeMailItem
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objMailItem
Set oMatches = oRE.Execute(objSafeMail.Body)
objSafeMail.RTFBody = oRE.Replace(objSafeMail.RTFBody, Link
&
"$1/$&")
objSafeMail.Save

For Each omatch In oMatches
objSafeMail.RTFBody = Replace(objSafeMail.RTFBody, "/" &
omatch.SubMatches(0) & "#", "/")
objSafeMail.Save
Next
End Sub

Thanks.






  #6  
Old April 29th 09, 08:36 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Hyperlinks is becoming non-clickable in RTFBody format

I don't remember it of the top of my head, but it shoul be easy to create a
clickable link through the OUtlook UI and then just look at the RTF data.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
I thought it is link and as it getting coverted to clickable link while
using
.Body so it should with .RTFBody as well. :-)

Could you tell me what are the RT Keywords and how could I use it to make
it
clickable hyper link. Example would be much helpful.

Thanks,
Paresh

"Dmitry Streblechenko" wrote:

Why do you expect it to become a hyperlink? You need to explicitly use
the
appropriate RTF keywords to mark soem string as a hyperlink.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
Dmitry, I could see the complete expected contents. Suppose my email
RTFbody
contains "This is a test#123." Then my Add-in converts it to "This is
http://mylink/Q/test/123." but the hyperlink is staying non-clickable.
If
I
do the same thing using email body (not RTFBody) then link get
converted
into
clickable link but format is getting changed to plain text. :-(

Thanks,
Paresh

"Dmitry Streblechenko" wrote:

And if you look at the RTF body, what exactly do you see?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"paresh" wrote in message
...
Hi,

I have written one add-in which replaces [a-zA-z]#[0-9] or
[a-zA-z]#[0-9]#[0-9] with the hyperlinks. It is working
fine(attached
portion
of code). I found the two problems.

1. The hyperlink (in format of "http://mylink/Q/") is getting
converted
into clickable link if I use objSafeMail.Body instead of
objSafeMail.RTFBody
in my code but usage of objSafeMail.Body converts mail format to
plain
text.

2. If I use objSafeMail.RTFBody then hyperlink is becoming
non-clickable.

Could any one suggest me if in Option#1 (while using
objSafeMail.Body)
it
is
possible to persist email format as it is OR in Option#2 is it
possible
to
make replaced hyperlink to clickable,

Code:

Private Sub objMailItem_Send(Cancel As Boolean)
Const Link = "http://mylink/Q/"
Const REQUEST_PATTERN = "([a-zA-Z]+)(\#[0-9]+){1,2}(?!\#)\b"
Set oRE = CreateObject("VBScript.Regexp")
With oRE
.IgnoreCase = True
.Global = True
.MultiLine = True
.Pattern = REQUEST_PATTERN
End With
objMailItem.BodyFormat = olFormatHTML
objMailItem.Save
Dim objSafeMail As Redemption.SafeMailItem
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objMailItem
Set oMatches = oRE.Execute(objSafeMail.Body)
objSafeMail.RTFBody = oRE.Replace(objSafeMail.RTFBody,
Link
&
"$1/$&")
objSafeMail.Save

For Each omatch In oMatches
objSafeMail.RTFBody = Replace(objSafeMail.RTFBody,
"/" &
omatch.SubMatches(0) & "#", "/")
objSafeMail.Save
Next
End Sub

Thanks.








 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending a clickable email RoyT Outlook and VBA 2 March 18th 09 09:15 PM
Blocked links still clickable Mark Hall Outlook - General Queries 0 February 22nd 07 02:30 PM
clickable links Debbie Outlook Express 16 October 22nd 06 10:51 PM
Problem with Outlook hyperlinks (html format - sorry..) Brian Tillman Outlook - General Queries 2 May 17th 06 02:54 AM
URL's not clickable in email Bob Day Outlook - General Queries 2 May 13th 06 05:06 PM


All times are GMT +1. The time now is 05:02 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.