I right click on an icon file in explorer window.
Here's my code
Option ExplicitPublic AlbanyLoad As Integer, CanastotaLoad As Integer, ChicopeeLoad As Integer, ColonieLoad As Integer
Public Body As String
Public ShipDate As Date
Private Sub UserForm_Initialize()
With LocationBox
.AddItem "Chicopee"
.AddItem "Albany"
.AddItem "Colonie"
.AddItem "Canastota"
End With
End Sub
Private Sub CommandButton1_Click()Dim oMail As Outlook.MailItem
ShipDate = Format(ShipDateBox.Value, "MM/DD/YY")
Body = "has been uploaded."
Set oMail = ActiveInspector.CurrentItem
Select Case LocationBox.Value
Case "Albany"
With oMail
.To = "Albany Report"
.Subject = "Albany " & ShipDate & " " & WeekdayName(Weekday(ShipDate)) & " Ship Uploaded"
.Body = AlbanyLoadbox.Value & " Albany Loads" & vbLf & CanastotaLoadBox.Value & " Canastota Loads" & vbLf & ChicopeeLoadBox.Value & " Chicopee Loads" & vbLf & ColonieLoadBox.Value & " Colonie Loads" & vbLf & vbLf & "Phil"
End With
Case "Canastota"
With oMail
.To = "Canastota Report"
.Subject = "Canastota " & ShipDate & " " & WeekdayName(Weekday(ShipDate)) & " Ship Uploaded"
.Body = CanastotaLoadBox.Value & " Canastota Loads" & vbLf & vbLf & "Phil"
End With
Case "Chicopee"
With oMail
.To = "Chicopee Report"
.Subject = "Chicopee " & ShipDate & " " & WeekdayName(Weekday(ShipDate)) & " Ship Uploaded"
.Body = ChicopeeLoadBox.Value & " Chicopee Loads" & vbLf & vbLf & "Phil"
End With
Case "Colonie"
With oMail
.To = "Colonie Report"
.Subject = "Colonie " & ShipDate & " " & WeekdayName(Weekday(ShipDate)) & " Ship Uploaded"
.Body = ColonieLoadBox.Value & " Colonie Loads" & vbLf & vbLf & "Phil"
End With
End Select
Unload Me
oMail.Send
End Sub
Public Sub ReportEmails()
UserForm1.Show
End Sub