Excel VBA Email Creation

Refresh

4 days ago

Views

17 time

0

I am new to using StackOverflow, so I apologize if I leave some things out. I have been trying for awhile to get this to work however there is just one small detail that I can't seem to get. Long story short, I have a data export from my company and I use that information to send out emails with certain information in it. I created a macro that will create everything for me which includes(the email, inserting data, and all of the text). The only issue that I am having, is that my default mail signature is not included at the bottom. I have no idea why. I thought it might have been the format of the email, Plain text, HTML, Rich text, etc. however it isn't. I have my code below. Any help is greatly appreciated! Also I do understand that there is probably a much neater and cleaner way to have made the code, but I was in a time crunch.

Sub ManifestRequest()
    On Error GoTo ErrHandler

    ' SET Outlook APPLICATION OBJECT.
    Dim objOutlook As Object
    Set objOutlook = CreateObject("Outlook.Application")

    ' CREATE EMAIL OBJECT.
    Dim objMail As Object
    Set objMail = objOutlook.CreateItem(0)

    Dim SelRange As Range
    Set SelRange = ActiveSheet.Range(Selection.Address)
    SelRange.Copy



    With objMail
        .To = ""
        .Subject = "Enter Subject Here" + SelRange
        .Body = "Enter Body Text Here"
        .Display        ' DISPLAY MESSAGE.
    End With

    ' CLEAR.
    Set objMail = Nothing
    Set objOutlook = Nothing


ErrHandler:
    '
End Sub

0 answers

Смотреть фильмы онлайн бабушка легкого поведения 2 фильм бесплатно