Ik weet niet of het mogelijk is om een soort knop/Taak te maken die de macro uit of aan kan zetten?
Ik gebruik deze macro om vanuit word een mail merge te verzenden.
Er is namelijk geen mogelijkheid om bij de mail merge namens iemand anders te mailen (Auto-Mapping).
Via onderstaande stukje macro lukt het wel.
mvg
Kasper
Ik gebruik deze macro om vanuit word een mail merge te verzenden.
Er is namelijk geen mogelijkheid om bij de mail merge namens iemand anders te mailen (Auto-Mapping).
Via onderstaande stukje macro lukt het wel.
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
On Error GoTo Err001
Dim objItem As Outlook.MailItem
If Item.Class = olMail Then
Set objItem = Item.Copy
'Set 'From' address
objItem.SentOnBehalfOfName = "test@test.nl"
' Join Email addresses by "; " into "objItem.BCC" as string
' Remove the single quote to add BCC.
'objItem.BCC = "test1@test.com"
' specify the file to attach
' repeat this line to add further attachments
' Remove the single quote to add Attachments.
'objItem.Attachments.Add "c:\test.pdf"
objItem.Send
Item.Delete
Cancel = True
End If
Exit Sub
Err001:
MsgBox "An error occurred while sending the email!"
End Sub
mvg
Kasper