Originally Posted by June7
What exactly do you not understand about the example code? You said your hyperlink works so you must have already written code to test. If you want to dynamically build hyperlink in code, then concatenate variable. Where will the hyperlink string come from? Post your attempted code.
Sorry, I should have been clearer. I am trying to add a text to the hyperlink as shown in bold below, but it just displays the code and does not convert it to an actual hyperlink. How do I modify the code to allow HTML formatting?
Public Sub Command6_Click()
Dim vTo, vCC, vSubj, vBody, vRpt, vForm, vHoy
Dim i As Integer
vRpt = "Report"
vQry = "qry_difference_achievement"
'scan the list box
For i = 0 To lstEAddrs.ListCount - 1
vItm = lstEAddrs.ItemData(i) 'get new item
lstEAddrs = vItm 'set list box to item
DoCmd.OpenReport vRpt, acPreview, , "[Form]= '" & lstEAddrs.Column(0) & "'"
vName = lstEAddrs.Column(1)
vForm = lstEAddrs.Column(0)
vHoy = lstEAddrs.Column(4)
vSubj = "XYZ: " & vForm & ""
vTo = lstEAddrs.Column(2) 'col 1 has ID, col2 has email (in vb, combo box items starts with 0)
vCC = "email@example.com;" & vHoy & ""
vBody = " "Test HL: <a href='folder path here'>Link description here</a>""
DoCmd.SendObject acSendReport, vRpt, acFormatPDF, vTo, vCC, , vSubj, vBody
DoCmd.Close acReport, "Form_Report"