Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2006, 09:58 AM
Authorized User
 
Join Date: Feb 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default hyperlink in vbscript

I am putting a web address in a users email and need to know how to make it as a hyperlink so that when user clicks on address in the body of their email it will auto go to the web address. Following is code that is being used.

Dim objMessage
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "New Intake"
'objMessage.Sender = """IT - Open Issues"" <[email protected]>"
objMessage.From = """IT - Open Issues"" <[email protected]>"
objMessage.To = left(oRecordSet.Fields("ClinicianFName"),1) & oRecordSet.Fields("ClinicianLName") & "@fcswichita.org;[email protected]"
objMessage.CC = "[email protected]"
objMessage.TextBody = "Information about your future scheduled intakes and reopens can be found on the following website. Enter " & oRecordset.Fields("Clinician") & " in the textbox, hit the enter key on your keyboard, and then click on the CLICK HERE TO VIEW REPORT link to see your future reopens and intakes." & chr(10) & chr(10) & chr(32) & chr(32) & "servername/myintranet/clinicianIDEntry.aspx" '& "Type" & chr(09) & "Client Name" & chr(09) & "Client DOB" & chr(09) & "Client Number" & chr(09) & chr(09) & "Scheduled Appointment" & chr(9) & "Insurance" & chr(09) & chr(09) & "Presenting Problem" & chr(10) & sMsg


'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "ntserver1.fcswichita.int"

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send

thanks for any wisdom

 
Old September 14th, 2006, 10:44 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This is flawed because if the user is using an Email Client that doesnt support HTML email, they wont see the link, they will just see text.

In anycase, in your body, just do a regular 'a href'

"The one language all programmers understand is profanity."
 
Old September 14th, 2006, 12:51 PM
Authorized User
 
Join Date: Feb 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I placed the a href in the code and it gave me an error.

<a href="servername/myintranet/clinicianIDEntry.aspx">Click Here</a>

 
Old September 14th, 2006, 12:55 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Thats because " " are string delimiters, you have to use ' '

"The one language all programmers understand is profanity."
 
Old September 26th, 2006, 01:52 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rather than using TextBody, Use HTMLBody.

Hope this helps

With Regards,
Raghavendra Mudugal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink not a Hyperlink? SBCUser666 Access VBA 0 March 5th, 2008 07:01 PM
Hyperlink carlos1972 Access VBA 2 November 7th, 2007 10:17 AM
hyperlink kritimehrotra Excel VBA 3 July 24th, 2006 08:32 PM
hyperlink pab006 Classic ASP Basics 5 December 17th, 2003 10:33 AM
Hyperlink viktor26 Classic ASP Basics 0 October 19th, 2003 09:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.