Dear World,
my Name is Annabel and I am quite new at world of VBA. I must admit I absolutely adore the feeling, when something works. Maybe you can help me, to get this feeling back.
I just learned how to generate an E-Mail based on an Excel-table. Now I would like to add a LINK when clicking on a special word.
The actual code is as follows:
[/ICODE]
The basic table is like this:
Do you know how to edit the code?
my Name is Annabel and I am quite new at world of VBA. I must admit I absolutely adore the feeling, when something works. Maybe you can help me, to get this feeling back.
I just learned how to generate an E-Mail based on an Excel-table. Now I would like to add a LINK when clicking on a special word.
The actual code is as follows:
VBA Code:
Sub Bulkversand()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Bulkversand_JF_TP")
Dim OA As Object
Dim msg As Object
'Update Date in List
ThisWorkbook.Sheets("Bulkversand").Range("G2").Value = Date
'Create Mail based on List
Set OA = CreateObject("Outlook.Application")
Dim i As Integer
Dim last_row As Integer
last_row = Application.WorksheetFunction.CountA(sh.Range("A:A"))
For i = 2 To last_row
Set msg = OA.CreateItem(0)
msg.To = sh.Range("A" & i).Value
msg.CC = sh.Range("B" & i).Value
msg.Subject = sh.Range("C" & i).Value
msg.Body = sh.Range("D" & i).Value
If sh.Range("E" & i).Value <> "" Then
msg.Attachments.Add sh.Range("E" & i).Value
End If
msg.Display 'alternativ .send
Next i
End Sub
The basic table is like this:
To | CC | Subject | Body | Attachments |
XXX@x.com | someone@y.com | Something | Hi there, please check out the following Link. (Here I would aprreciate a Link to Sharepoint when clicking on the word "Link") BR Annabel |
Do you know how to edit the code?