Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink with ID number

Status
Not open for further replies.
Feb 25, 2008
46
US

I am setting up an application which send emails to recipients whose email addresses are acquired from a MS-Access DB table.

The email content contains a hypelink to a website form.

I need to add the ID number of each recipient to the hyperlink so that I can capture who responded to the email request.

Can somebody help me with the syntax of the hyperlink wherein each recipients ID number is included in the Hyperlink?

Thanks in advance.
 
What is your actual code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Here's the code

-----------------------------------------
Dim db As DAO.Database
Dim MailList As DAO.Recordset
Dim MyOutlook As Outlook.Application
Dim MyMail As Outlook.MailItem
Dim Subjectline As String
Dim BodyFile As String
Dim fso As FileSystemObject
Dim MyBody As TextStream
Dim MyBodyText As String

Set fso = New FileSystemObject

' subject line of Email.


Subjectline$ = "Please answer the questionnaire on the website",



' Content of the email

BodyFile$ = C:\Database\EmailMsg.txt



' Open text file.
Set MyBody = fso_OpenTextFile(BodyFile, ForReading, False, TristateUseDefault)

' reading it into a variable.
MyBodyText = MyBody.ReadAll

'close the file.
MyBody.Close

' Open Outlook ..
Set MyOutlook = New Outlook.Application


' Set up the database and query connections

Set db = CurrentDb()

Set MailList = db.OpenRecordset("MyEmailAddresses")

' Main process.
' Loop through our list of addresses,
' Adding them to e-mails and sending them.

Do Until MailList.EOF

' This creates the e-mail

Set MyMail = MyOutlook.CreateItem(olMailItem)

' This addresses it
MyMail.To = MailList("email")

'This gives it a subject
MyMail.Subject = Subjectline$

'This gives it the body
MyMail.Body = "Ref: Interaction with Team member - " & MailList("TMName") & " on " & MailList("Date") & " at " & MailList("Time") & " hours " & vbNewLine & " about member with ID Number - " & MailList("MemberID") & vbNewLine & vbNewLine & MyBodyText



'This sends the email
MyMail.Send





'Move on to the next one...
MailList.MoveNext

Loop

'Reset process

Set MyMail = Nothing

'MyOutlook.Quit
Set MyOutlook = Nothing

MailList.Close
Set MailList = Nothing
db.Close
Set db = Nothing

End Function


----------------------------------------------

The hyperlink is mentioned in the text message

I trying to have the memberID attached at the end of the hyperlink.

Thanks for your help, PHV!
 
Have a look at the InStr and Mid functions.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

PHV,

I was looking at the code I posted again.

I realized that the ID number I want to insert at the end of the URL is present at the end of the "MyMail.Body = ..."
line in the code.

Is there a way I can add a syntax in the URL to pick the ID number from the "MyMail.Body = ...." line in the code I posted?

Thanks.
 
Which URL ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top