Consulting

Results 1 to 5 of 5

Thread: Outlook email with fillable fields

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Outlook email with fillable fields

    I am not very good at outlook and am looking for some advice on how to proceed or an example from the web.

    I am having to send a lot of emails for different customers and the ones I inherited are text fields with XXXXXXX for name and XXXXXXX for amount. Is there a way to have some sort of field in the body of the email where you can just have a space to enter the name and amount without having to remove the XXXXX with the delete key and then enter the information.

    I seem to have seed something a long time ago with that but I think it might have been a PDF.

    Any help or direction appreciated.
    Peace of mind is found in some of the strangest places.

  2. #2
    Put your list of customers and amounts in an Excel worksheet and you could use mail merge to e-mail. Copy the message to a Word document and replace the Xs with merge fields from your Excel file.
    I suspect that you may find https://www.gmayor.com/ManyToOne.htm useful - probably in one to one mode.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    606
    Location
    .
    Option Explicit
    
    
    Sub eMail()
    Dim lRow As Integer
    Dim i As Integer
    Dim toDate As Date
    Dim toList As String
    Dim eSubject As String
    Dim eBody As String
    Dim OutApp
    Dim OutMail
    
    
    With Application
        .ScreenUpdating = False
        .EnableEvents = False
        .DisplayAlerts = False
    End With
    
    
    Sheets(1).Select
    lRow = Cells(Rows.Count, 4).End(xlUp).Row
    
    
    For i = 2 To lRow
        If Cells(i, 5) = "" Then
          If (Cells(i, 1)) = 1 Then
             Set OutApp = CreateObject("Outlook.Application")
             Set OutMail = OutApp.CreateItem(0)
        
                toList = Cells(i, 2)    'gets the recipient from col D
                eSubject = Cells(i, 3)
                
                eBody = Cells(i, 4)
        
                On Error Resume Next
                With OutMail
                .To = toList
                .CC = ""
                .BCC = ""
                .Subject = eSubject
                .Body = eBody
                .Display   ' ********* Creates draft emails. Comment this out when you are ready
                '.Send     '********** UN-comment this when you  are ready to go live
                End With
         
                On Error GoTo 0
                Set OutMail = Nothing
                Set OutApp = Nothing
             Cells(i, 5) = "Mail Sent " & Date + Time 'Marks the row as "email sent in Column A"
            End If
        End If
    Next i
    
    
    ActiveWorkbook.Save
    Sheets(2).Select
    With Application
        .ScreenUpdating = True
        .EnableEvents = True
        .DisplayAlerts = True
    End With
    End Sub
    Attached Files Attached Files

  4. #4
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks. I'll give it a try.
    Peace of mind is found in some of the strangest places.

  5. #5
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    606
    Location
    .
    You are welcome.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •