Email Template VBA Link

stu_c

Registered User.
Local time
Today, 04:25
Joined
Sep 20, 2007
Messages
492
Hi All
Initially I was looking to open a outlook Pre Filled Email template and input the data form a form but was turning out to be a bit of a nightmare, I then managed to create the below code that opens up a blank email and all the data is entered that way which works fine, I ideally I now need a CLICK HERE hyperlink on the email body but not sure what code to create a CLICK HERE Link any suggestions?

Code:
   Dim oWo  As Object 'Outlook.Application
    Dim oDoc1 As Object 'Word.Document
 
    
    'Set oWd = New Word.Application
    Set myOlApp = CreateObject("Outlook.Application")
    Set myitem = myOlApp.CreateItemFromTemplate(CurrentProject.Path & "\TemplateFiles\BitLocker.oft")
    myitem.Subject = UCase("HR RECORDS - " & "[" & [Forms]![FRM_TBLALL_FullDetails].[Form]![LblEmployeeRef] & "]" & " " & "[" & [Forms]![FRM_TBLALL_FullDetails]![SFRM_TBLALL_StaffDetails].[Form]![LblDate] & "]")
    myitem.to = "HR EMAIL ADDRESS"
    
    myitem.body = "Morning / Afternoon" & Chr(13) & Chr(10) & _
    "Please see all relevant files required." & Chr(13) & Chr(10) & _
    "BitLocker password is:" & Chr(13) & Chr(10) & [Forms]![FRM_TBLALL_FullDetails]![SFRM_TBLALL_StaffDetails]![BitLockerPassword] & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
    "A how to guide on how to access BitLocker and using the reports can be viewed HERE"
    
 End Fuction
 
You will likely need to make the email html, not plain text.
See similar threads for html syntax.

BTW fuction is mispelled?
 

Users who are viewing this thread

Back
Top Bottom