Forum Discussion

Mark Lee's avatar
Mark Lee
Copper Contributor
Sep 24, 2018

create an macro to create an email with a blank table

I have managed to get to grips with creating an email and adding the text i need including leaving in the default signature.

However what i need is to create 3 new macros with different text in an email but including a 4x2 table in the middle of the text. because of the number of variable options i think it would be better to have a blank table in email which i can add data to rather than copy from excel sheet.

 

the coding i have so far is

 

Dim OutApp As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Recipient
Dim Recipients As Recipients
Dim HTMLbody As String

Set OutApp = CreateObject("Outlook.Application")
Set objOutlookMsg = OutApp.CreateItem(olMailItem)
With objOutlookMsg
.Display
End With
Signature = objOutlookMsg.HTMLbody

With objOutlookMsg
.Subject = "Non Compliant Purchase Order"
.HTMLbody = "<p>You recently created the following Purchase Order which is showing on our reports as being non-compliant as it has not been linked to a contract.<p>To enable us to correct this before the end of the reporting period please advise as soon as possible, but not later than <b>Wednesday DDth MONTH</b>, of the correct Contract Number.<p>A list of the current Contracts on AccountNI can be found here.<p>If you have any questions or require further guidance please feel free to give me a call." & vbNewLine & Signature

End With

Set OutApp = Nothing

 

This is the output i would like

 

You recently created the following Purchase Order which is showing on our reports as being non-compliant as it has not been linked to a contract.

 

       

PO Ref

PO Line Description

Supplier Name

PO Value

    

                                    

To enable us to correct this before the end of the reporting period please advise as soon as possible, but not later than Wednesday DDth Month, of the correct Contract Number.

 

A list of the current Contracts on AccountNI can be found here

 

If you have any questions or require further guidance please feel free to give me a call

No RepliesBe the first to reply

Resources