Excel Email function for user database

I've been trying to modify this code in several ways but I can't quite figure out how to layer everything without it bugging, I'd like to

a) Use different sections for the email generation where the email address/surname/forename/location are in my user database example (i.e. the option to send an email to certain locations/levels of people)

b) Have a popup screen appear for the body of the email text, I don't like the idea of my secretary having to go into the code to change the text

c) Another popup box requesting an email identifier that will set a 'flag' in the Email Information column to show they've had that email and (this may be ambitious) to record the body of the email text somewhere that I can review so there's a record of what's been sent out - maybe using the same email identifier that's been added to the email column? (possibly as a hyperlink?)

This is the basic code I've been working with but somehow I don't think it's fit for purpose. Tried uploading the example file but it refuses to attach - hopefully I can add it after I post this

Dim oXlWkBk As [url removed, login to view] ' Excel Work Book Object

Dim oOLApp As [url removed, login to view]

Dim oOLMail As MailItem

Dim lRow As Long

Dim olMailItem

Dim sMailID As String

Dim sSalutation As String

Dim sName As String

Dim sDetails As String

Dim sSubject As String

On Error GoTo Err_Trap

Set oXlWkBk = ActiveWorkbook

If [url removed, login to view](1).[url removed, login to view](xlCellTypeLastCell).Row < oolapp =" New" lrow =" 2" oolmail =" [url removed, login to view](olMailItem)" ssalutation =" [url removed, login to view](1).Cells(lRow," sname =" [url removed, login to view](1).Cells(lRow," sdetails = "Hi"> 0 And LenB(Trim$(sSalutation)) <> 0) Then

sDetails = sSalutation & " " & sName

ElseIf LenB(Trim$(sName)) <> 0 Then

sDetails = sName


sDetails = "Hi"

End If

sDetails = sDetails & vbNewLine & vbNewLine

sMailID = Trim$([url removed, login to view](1).Cells(lRow, 3).Value)

' --- Validate EMail ID

If InStr(1, sMailID, "@") = 0 Then

GoTo TakeNextRow

End If

' Create Mail

With oOLMail

.To = sMailID

.Subject = sSubject

.Body = sDetails & "This is a test mail from Paul the useless underling"

End With

[url removed, login to view]


Next lRow

[url removed, login to view] (False)


'Destroy Objects

If Not oOLApp Is Nothing Then Set oOLApp = Nothing


' Error Handling

If Err <> 0 Then

MsgBox [url removed, login to view], vbInformation, "VBADUD AutoMail"

[url removed, login to view]

GoTo Destroy_Objects

End If

This isn't massively urgent or particularly mandatory but it might be useful if anyone else starts playing with my databases.

Kemahiran: Excel, Visual Basic

Lihat lebih lanjut: excel email function, test user, sheets add, secretary 2, how to create e book, handling e mail, handling Email, example of idea generation, err go, e mail handling, clear a string in c, t paul, how to change mail address, validate excel, User test, user review, urgent excel, Trim, send email excel, row b, outlook email, Instr, excel function, excel $2-30, email handling and

Tentang Majikan:
( 4 ulasan ) Oxford, United Kingdom

ID Projek: #1597898

Dianugerahkan kepada:


Hi, I can assist you with this. Sending you some suggestions in a second. Kind Regards

£40 GBP dalam sehari
(27 Ulasan)

6 pekerja bebas membida secara purata £49 untuk pekerjaan ini


Please check your PM.

£80 GBP dalam sehari
(20 Ulasan)

Hi, I can do it. Pls check the PMB for details.

£30 GBP dalam 2 hari
(28 Ulasan)

Hello, We are expert & dedicated software development team. As per your requirement...we are very much interested for your project. We can complete your project quickly and efficiently in time. Details will be discuss Lagi

£80 GBP dalam 5 hari
(0 Ulasan)

Dear Sir; I assure you that I can easily meet most of the mentioned requirements. I have 15 years VB and VBA experience. Just give me a chance to fulfill your satisfaction. I can do your job according to your directio Lagi

£30 GBP dalam 7 hari
(0 Ulasan)

Hello, What version of excel, outlook, and Database are you using. I have done several projects that utilize this technique. I have also embedded outlook into other programs such as autocad to email bill of materi Lagi

£35 GBP dalam 5 hari
(0 Ulasan)