A Microsoft Office (Excel, Word) forum. OfficeFrustration

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 » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

replace http:// with mailto:



 
 
Thread Tools Display Modes
  #1  
Old May 1st, 2005, 12:59 AM
tlaker
external usenet poster
 
Posts: n/a
Default replace http:// with mailto:

when entering an e-mail address on my form, Access 2000 changes it so that it
links to a webpage. How can I replace the "http://" with "mailto:" after
update?
  #2  
Old May 1st, 2005, 01:10 AM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default

"tlaker" wrote in message:
...

when entering an e-mail address on my form, Access 2000 changes it so that it
links to a webpage. How can I replace the "http://" with "mailto:" after
update?


Hi,

It sounds like you have the table field defined to be a Hyperlink field.
I would set the field to be a text field, not Hyperlink to avoid this problem.

Here is a past post of mine on this issue which details how to avoid
the problem you are having, as well as how to send the person an e-mail
message by double clicking on that form field.


1. Make a field in the table called EmailAddress set as Text (not hyperlink).

2. Enter the e-mail addresses like so on the data entry form:

They will not have to type the "mailto" part

3. Code the double-click event of that field's control on the data entry form like so:

Private Sub EmailAddress_DblClick(Cancel As Integer)
On Error GoTo ErrorPoint

Dim strEmail As String

' Stop the Web Toolbar from appearing
DoCmd.ShowToolbar "Web", acToolbarNo

If Not IsNull(Me.EmailAddress) Then
strEmail = Me.EmailAddress
If Left(strEmail, 7) "mailto:" Then
strEmail = "mailto: " & strEmail
End If
Application.FollowHyperlink strEmail
End If

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " _
& Err.Description, vbExclamation, _
"Unexpected Error"
Resume ExitPoint

End Sub

Double-clicking on that field will bring up Outlook (assuming that is
what you are using) with a new message and their e-mail address already filled in.


Hope that gets you going,
--
Jeff Conrad
Access Junkie
Bend, Oregon


  #3  
Old May 1st, 2005, 03:04 AM
Steve Schapel
external usenet poster
 
Posts: n/a
Default

Tlaker,

Do you mean that Access is literally inserting a "http://" string in
front of the data you are entering? I have not seen this before. As
you have suggested, you will get the behaviour you seek if the mailto
protocol identifier is used in your data. I would normally use code
like this on the afterupdate event of the control...
If Me.Email Like "mailto:*" Then
' do nothing
Else
Me.Email = "mailto:" & Me.Email
End If

But this assumes the code is just working with the text you entered. If
you literally have a http identifier there, try it like this...
If Me.Email Like "mailto:*" Then
' do nothing
ElseIf Me.Email Like "http*" Then
Me.Email = Replace(Me.Email,"http://","mailto:")
Else
Me.Email = "mailto:" & Me.Email
End If

--
Steve Schapel, Microsoft Access MVP


tlaker wrote:
when entering an e-mail address on my form, Access 2000 changes it so that it
links to a webpage. How can I replace the "http://" with "mailto:" after
update?

  #4  
Old May 1st, 2005, 11:07 PM
tlaker
external usenet poster
 
Posts: n/a
Default

thanks Jeff, I'll give it a try

"Jeff Conrad" wrote:

"tlaker" wrote in message:
...

when entering an e-mail address on my form, Access 2000 changes it so that it
links to a webpage. How can I replace the "http://" with "mailto:" after
update?


Hi,

It sounds like you have the table field defined to be a Hyperlink field.
I would set the field to be a text field, not Hyperlink to avoid this problem.

Here is a past post of mine on this issue which details how to avoid
the problem you are having, as well as how to send the person an e-mail
message by double clicking on that form field.


1. Make a field in the table called EmailAddress set as Text (not hyperlink).

2. Enter the e-mail addresses like so on the data entry form:

They will not have to type the "mailto" part

3. Code the double-click event of that field's control on the data entry form like so:

Private Sub EmailAddress_DblClick(Cancel As Integer)
On Error GoTo ErrorPoint

Dim strEmail As String

' Stop the Web Toolbar from appearing
DoCmd.ShowToolbar "Web", acToolbarNo

If Not IsNull(Me.EmailAddress) Then
strEmail = Me.EmailAddress
If Left(strEmail, 7) "mailto:" Then
strEmail = "mailto: " & strEmail
End If
Application.FollowHyperlink strEmail
End If

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " _
& Err.Description, vbExclamation, _
"Unexpected Error"
Resume ExitPoint

End Sub

Double-clicking on that field will bring up Outlook (assuming that is
what you are using) with a new message and their e-mail address already filled in.


Hope that gets you going,
--
Jeff Conrad
Access Junkie
Bend, Oregon



  #5  
Old May 2nd, 2005, 01:08 AM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default

"tlaker" wrote in message:
...

thanks Jeff, I'll give it a try


You're welcome, good luck with your project.
--
Jeff Conrad
Access Junkie
Bend, Oregon


  #6  
Old May 2nd, 2005, 03:46 AM
david epsom dot com dot au
external usenet poster
 
Posts: n/a
Default


"if you type , what is actually stored in the database is
#a href="http://...xample.com/a
# "

http://support.microsoft.com/default...b;en-us;323202
HOW TO: Change the Values in a Hyperlink Field from an HTTP Address
to a MAILTO Address in Microsoft Access 2000

(david)

"Steve Schapel" wrote in message
...
Tlaker,

Do you mean that Access is literally inserting a "http://" string in front
of the data you are entering? I have not seen this before. As you have
suggested, you will get the behaviour you seek if the mailto protocol
identifier is used in your data. I would normally use code like this on
the afterupdate event of the control...
If Me.Email Like "mailto:*" Then
' do nothing
Else
Me.Email = "mailto:" & Me.Email
End If

But this assumes the code is just working with the text you entered. If
you literally have a http identifier there, try it like this...
If Me.Email Like "mailto:*" Then
' do nothing
ElseIf Me.Email Like "http*" Then
Me.Email = Replace(Me.Email,"http://","mailto:")
Else
Me.Email = "mailto:" & Me.Email
End If

--
Steve Schapel, Microsoft Access MVP


tlaker wrote:
when entering an e-mail address on my form, Access 2000 changes it so
that it links to a webpage. How can I replace the "http://" with
"mailto:" after update?



  #7  
Old May 2nd, 2005, 07:12 PM
Steve Schapel
external usenet poster
 
Posts: n/a
Default

Thanks, David, I have learned something here.

--
Steve Schapel, Microsoft Access MVP


david epsom dot com dot au wrote:
"if you type , what is actually stored in the database is
#a href="http://...xample.com/a
# "

http://support.microsoft.com/default...b;en-us;323202
HOW TO: Change the Values in a Hyperlink Field from an HTTP Address
to a MAILTO Address in Microsoft Access 2000

(david)

  #8  
Old October 4th, 2007, 04:46 PM posted to microsoft.public.access.gettingstarted
MikeP125
external usenet poster
 
Posts: 16
Default replace http:// with mailto:

This code to create an email by double clicking is great! Can code be added
so that not only will it fill in the email address, it will fill in the
subject line and message body based on two separate text fields that I
already have populated?

"Jeff Conrad" wrote:

"tlaker" wrote in message:
...

when entering an e-mail address on my form, Access 2000 changes it so that it
links to a webpage. How can I replace the "http://" with "mailto:" after
update?


Hi,

It sounds like you have the table field defined to be a Hyperlink field.
I would set the field to be a text field, not Hyperlink to avoid this problem.

Here is a past post of mine on this issue which details how to avoid
the problem you are having, as well as how to send the person an e-mail
message by double clicking on that form field.


1. Make a field in the table called EmailAddress set as Text (not hyperlink).

2. Enter the e-mail addresses like so on the data entry form:

They will not have to type the "mailto" part

3. Code the double-click event of that field's control on the data entry form like so:

Private Sub EmailAddress_DblClick(Cancel As Integer)
On Error GoTo ErrorPoint

Dim strEmail As String

' Stop the Web Toolbar from appearing
DoCmd.ShowToolbar "Web", acToolbarNo

If Not IsNull(Me.EmailAddress) Then
strEmail = Me.EmailAddress
If Left(strEmail, 7) "mailto:" Then
strEmail = "mailto: " & strEmail
End If
Application.FollowHyperlink strEmail
End If

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " _
& Err.Description, vbExclamation, _
"Unexpected Error"
Resume ExitPoint

End Sub

Double-clicking on that field will bring up Outlook (assuming that is
what you are using) with a new message and their e-mail address already filled in.


Hope that gets you going,
--
Jeff Conrad
Access Junkie
Bend, Oregon



  #9  
Old January 21st, 2009, 10:17 PM posted to microsoft.public.access.gettingstarted
takenote
external usenet poster
 
Posts: 1
Default replace http:// with mailto:

To update many email at once in 2003 create an update query. In design type
'a href="mailto:'+[email]+'"'+[email]+'/a' in Update To:. It will then
update your table.

"tlaker" wrote:

when entering an e-mail address on my form, Access 2000 changes it so that it
links to a webpage. How can I replace the "http://" with "mailto:" after
update?

 




Thread Tools
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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
loop for replace function luzippu Running & Setting Up Queries 2 March 24th, 2005 11:13 AM
Find and Replace anomaly BruceM General Discussion 7 January 18th, 2005 06:47 PM
Find and Replace in Word 97 Doug Robbins - Word MVP General Discussion 1 May 28th, 2004 02:41 PM
find all / replace all used in a selected range oldguy Worksheet Functions 0 February 26th, 2004 02:05 PM


All times are GMT +1. The time now is 10:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.