Create individualized employee email messages

Status
Not open for further replies.
K

ker_01

We have a vendor who manages the web-based presentation of some required

compliance training. To improve the process, we would like to send out an

individualized URL to every employee (probably using their Employee ID in the

URL) instead of the current process, which requires each employee to click a

generic URL and log in.

Other than the obvious (a VBA loop through an array of email addresses and

Employee IDs, probably loaded from an Excel file) are there any other tips,

tricks, or gotchas associated with this type of bulk internal email

generation? All emails will only be to our internal employees, but we do have

several domains and two different exchange servers. I anticipate that we

would generate 100% of these emails from one location (one computer, which is

on Exchange Server 1), just for convenience.

Example:

Group 1/ Exchange Server 1: @companyUSA.com

: @companyCorp.com

: @companyservice.com

Group 2/ Exchange Server 2: @companyEMEA.com

I'd be more likely to do this from Outlook2007, but could use Outlook2003 if

there was a good reason to do so (if any relevant features have been

depreciated).

I'm be inclined to do this in Outlook (despite my greater familiarity with

Excel VBA) to avoid getting a warning with each email, or having to set it up

with CDO.

I appreciate any thoughts you have; I am interested in feedback on overall

approach or potential problems, I don't think the code itself will be that

much of a problem, but I want to make sure I figure out the best solution

before I start coding for it. If I have code problems I can alway post those

later.

Many thanks,

Keith
 
Something to tinker with ... First you need to create a

distributionlist of email-adresses. In this example the name is

'LijstMailing'. Then we create an email for each person on the list.

When using an external excelfile for holding the relevant id for the

person that gets an email, you could be able to create an individual

body for the email. Or export the list from excel to a delimited

textfile. Then we loop through each line of the txt file and put those

in an array. Later use the array to find the correct email address and

corresponding id.

VBA Code:

------------------
Sub Send_Mailing()

Dim DList As DistListItem, i As Long

Dim MyMessage As Outlook.MailItem

'Since outlook doesn't have the getopenfilename

'we use the excelobject

Dim oExcel As Object

Dim vFile

Set oExcel = CreateObject("Excel.Application")

'LijstMailing is the name of your distributionlist with all

'the contacts that you want to receive a mail

Set DList = Application.Session.GetDefaultFolder(olFolderContacts). _

Items("LijstMailing")

vFile = oExcel.GetOpenFilename(MultiSelect:=False)

For i = 1 To DList.MemberCount

Set MyMessage = Application.CreateItem(olMailItem)

With MyMessage

> To = DList.GetMember(i).Address

> Subject = "Personal URL Mailing"

> Body = "Here some info regarding your training."

If vFile <> False Then

'Here the code for adding the unique url

> Body = .Body & vbNewLine & "Personal url : ..."

'or change coding to use a delimited textfile with two dimensional array

'instead of just adding an attachment. This part will only be processed

'when you have chosen a file with the e-mails and id's of the participants

> Attachments.Add vFile

End If

> Display

'If you don't want to display the message use .Send instead

'of .Display

'.Send

End With

Next i

'Clear the object

Set oExcel = Nothing

End Sub

--------------------
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
B Modify VBA to create a RULE to block multiple messages Outlook VBA and Custom Forms 0
J Want to create a button on the nav bar (module add-in) to run code Outlook VBA and Custom Forms 2
B How to create a button that sorts and selects the most recent message with ONE click Using Outlook 2
J PSA: How to create custom keyboard shortcut for "Paste Unformatted Text" in Outlook on Windows Outlook VBA and Custom Forms 1
W Create a Quick Step or VBA to SAVE AS PDF in G:|Data|Client File Outlook VBA and Custom Forms 1
Wotme create email only data file Using Outlook 1
S Outlook 365 Help me create a Macro to make some received emails into tasks? Outlook VBA and Custom Forms 1
J How to create a drop down user defined field that will appear on an inbox view Outlook VBA and Custom Forms 8
Commodore Any way to create "from-only" account on Outlook 2021? Using Outlook 1
L Capture email addresses and create a comma separated list Outlook VBA and Custom Forms 5
N Can't create NEW GROUP and add/remove a member from existing Group in Outlook Using Outlook 1
NVDon Create new Move To Folder list Outlook VBA and Custom Forms 0
C Create Meeting With Custom Form Outlook VBA and Custom Forms 2
D Create advanced search (email) via VBA with LONG QUERY (>1024 char) Outlook VBA and Custom Forms 2
G Create ordinal numbers for birthday Outlook VBA and Custom Forms 2
O Outlook 365 - How to create / copy a new contact from an existing one? Using Outlook 5
D Create new email from the received Email Body with attachment Outlook VBA and Custom Forms 10
A How to create fixed signatures for aliases that process through GMAIL? Outlook VBA and Custom Forms 0
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 2
M How create a Rule to filter sender's email with more that one @ sign Using Outlook 1
B Can I create a local PST file for SPAM on a drive that is usually disconnected? Using Outlook 3
Chiba Create an appointment for all the members Outlook VBA and Custom Forms 1
S Create a clickable custom column field Outlook VBA and Custom Forms 0
O Create a custom contact form - questions before messing things up... Outlook VBA and Custom Forms 4
L automaticaly create a teams meeting with a sync Using Outlook 0
D Can Exchange Admin Center create a pst for users email/contacts/calendar? Exchange Server Administration 0
S Create A Search Folder That Looks For Message Class? Outlook VBA and Custom Forms 0
F How to create phone number as links in notes of Contacts Using Outlook 2
Nessa Can't create new appointment Using Outlook 1
A Create date folder and move messages daily Outlook VBA and Custom Forms 1
C Create new Message with shared contacts & BCC'ing recipients Outlook VBA and Custom Forms 0
O Multiple email accounts - hesitate to create a new profile Using Outlook 3
G Can't create Folder Groups in Outlook 2013 Using Outlook 0
N Outlook rules don't create a copy for bcc'ed emails Using Outlook 3
F Delete/create/reset Exchange mailbox on Outlook.com Using Outlook.com accounts in Outlook 3
R Can not create folder to store specific emails in in Outlook for Mac Using Outlook 1
W Create Search Folder excluding Specific Email Addresses Using Outlook 5
A Outlook macro to create search folder with mail categories as criteria Outlook VBA and Custom Forms 3
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
JackBlack What tools do you use to create the signature for email? Using Outlook 3
Rupert Dragwater How to create a new email with @outlook.com Using Outlook.com accounts in Outlook 32
F Should a new email account also create new contacts Using Outlook 2
D create an html table in outlook custom form 2010 using vba in MsAccess Outlook VBA and Custom Forms 7
R Outlook add-in to create new contact from an email. Using Outlook 0
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
Q Script to create a pst file for Archiving Using Outlook 1
Jennifer Murphy Can I create a Rule with Or'd conditions? Using Outlook 1
D Outlook macros to create meeting on shared calendar Outlook VBA and Custom Forms 10
G How do I create a custom pick list in VB for an outlook automated email? Outlook VBA and Custom Forms 1

Similar threads

Back
Top