I have a code I am working with and it works great.
I am trying to modify it so the fields on the form are outputted in bold and uppercase. Any help on this?
Also, it there a way to build an email message template - like a MSWord mail merge, and have the current record on the form populate the body of the message?
Here is the code I am working with:
'******begin code******
Dim ATTN As String
Dim IID1 As String
Dim FleetType As String
Dim Nomenclature As String
Dim PN As String
Dim GTWY1 As String
Dim hashave As String
Dim DeAllocationReason As String
Dim GTWY2 As String
Dim GTWY3 As String
Dim TotalAllocations As String
Dim BO As String
Dim Summary As String
Dim emailcontact As String
Dim ATLAS As String
Dim PHONE As String
'**create variables for Outlook
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'**gathers information from your form. this sets the string variable to your fields
ATTN = Me!ATTN
IID1 = Me!IID1
FleetType = Me!FleetType
Nomenclature = Me!Nomenclature
PN = Me!PN
GTWY1 = Me!GTWY1
hashave = Me!hashave
DeAllocationReason = Me!DeAllocationReason
GTWY2 = Me!GTWY2
GTWY3 = Me!GTWY3
TotalAllocations = Me!TotalAllocations
BO = Me!BO
Summary = Me!Summary
emailcontact = Me!emailcontact
ATLAS = Me!ATLAS
PHONE = Me!PHONE
'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application"
Set objEmail = objOutlook.CreateItem(olMailItem)
'***creates and sends email " Date Targeted for Completion ---& " DatTarget & "
With objEmail
.TO = IID1
.Subject = " WWR P/N " & PN & " " & Nomenclature
.Body = "ATTN: " & ATTN & " PN --- " & Nomenclature & " " & "---- TotalAllocations --->>> " & Summary & " ----------->>>>>>>>>>>>>>> When you request Follow up information, Please refer to the W/O Number"
.Display
'*** "SEND"- sends the email in Outlook. Change to DISPLAY if you want to be able to
'modify or see what you have created before sending the email
End With
'**closes outlook
objOutlook.Quit
Set objEmail = Nothing
Exit Sub
'****end code****
End Sub
I am trying to modify it so the fields on the form are outputted in bold and uppercase. Any help on this?
Also, it there a way to build an email message template - like a MSWord mail merge, and have the current record on the form populate the body of the message?
Here is the code I am working with:
'******begin code******
Dim ATTN As String
Dim IID1 As String
Dim FleetType As String
Dim Nomenclature As String
Dim PN As String
Dim GTWY1 As String
Dim hashave As String
Dim DeAllocationReason As String
Dim GTWY2 As String
Dim GTWY3 As String
Dim TotalAllocations As String
Dim BO As String
Dim Summary As String
Dim emailcontact As String
Dim ATLAS As String
Dim PHONE As String
'**create variables for Outlook
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'**gathers information from your form. this sets the string variable to your fields
ATTN = Me!ATTN
IID1 = Me!IID1
FleetType = Me!FleetType
Nomenclature = Me!Nomenclature
PN = Me!PN
GTWY1 = Me!GTWY1
hashave = Me!hashave
DeAllocationReason = Me!DeAllocationReason
GTWY2 = Me!GTWY2
GTWY3 = Me!GTWY3
TotalAllocations = Me!TotalAllocations
BO = Me!BO
Summary = Me!Summary
emailcontact = Me!emailcontact
ATLAS = Me!ATLAS
PHONE = Me!PHONE
'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application"
Set objEmail = objOutlook.CreateItem(olMailItem)
'***creates and sends email " Date Targeted for Completion ---& " DatTarget & "
With objEmail
.TO = IID1
.Subject = " WWR P/N " & PN & " " & Nomenclature
.Body = "ATTN: " & ATTN & " PN --- " & Nomenclature & " " & "---- TotalAllocations --->>> " & Summary & " ----------->>>>>>>>>>>>>>> When you request Follow up information, Please refer to the W/O Number"
.Display
'*** "SEND"- sends the email in Outlook. Change to DISPLAY if you want to be able to
'modify or see what you have created before sending the email
End With
'**closes outlook
objOutlook.Quit
Set objEmail = Nothing
Exit Sub
'****end code****
End Sub