hi all, i am hoping you can help. I am trying to either add .from to the below code! Any help would be amazing!
Sub SendEmail()
Application.ScreenUpdating = False
Dim OutlookApp As Object
Dim MItem As Object
Dim cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim Account As String
Dim Invoice As String
Dim Amount As String
Dim Answer As String
Dim MyNote As String
MyNote = "Do you realy want to do this?"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "???")
If Answer = vbNo Then
MsgBox ""
Else
Sheets("Send").Activate
Set ob***p = CreateObject("Outlook.Application")
For Each cell In Columns("J").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "*@*" Then
EmailAddr = cell.Value
Account = cell.Offset(0, -9).Value
Invoice = cell.Offset(0, -8).Value
Amount = cell.Offset(0, -7).Value
Store = cell.Offset(0, -6).Value
Msg =
Msg =
Msg =
Msg =
Subj =
Set OutlookApp = CreateObject("Outlook.Application")
Set MItem = OutlookApp.CreateItem(0)
With MItem
.To = EmailAddr
.Subject = Subj
.Body = Msg
SendKeys ("{ENTER}")
.Display
SendKeys ("%{s}")
End With
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 1
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
End If
Next
End If
End Sub
If this cannot be done then is there a way to add this there (baring in mind this will be sent from excel)
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.ReplyRecipients.Add "creditcontrol@dsgibusiness.com"
Item.ReplyRecipients.Item(1).Resolve
Item.Save
End Sub
Thanks Steve
Sub SendEmail()
Application.ScreenUpdating = False
Dim OutlookApp As Object
Dim MItem As Object
Dim cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim Account As String
Dim Invoice As String
Dim Amount As String
Dim Answer As String
Dim MyNote As String
MyNote = "Do you realy want to do this?"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "???")
If Answer = vbNo Then
MsgBox ""
Else
Sheets("Send").Activate
Set ob***p = CreateObject("Outlook.Application")
For Each cell In Columns("J").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "*@*" Then
EmailAddr = cell.Value
Account = cell.Offset(0, -9).Value
Invoice = cell.Offset(0, -8).Value
Amount = cell.Offset(0, -7).Value
Store = cell.Offset(0, -6).Value
Msg =
Msg =
Msg =
Msg =
Subj =
Set OutlookApp = CreateObject("Outlook.Application")
Set MItem = OutlookApp.CreateItem(0)
With MItem
.To = EmailAddr
.Subject = Subj
.Body = Msg
SendKeys ("{ENTER}")
.Display
SendKeys ("%{s}")
End With
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 1
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
End If
Next
End If
End Sub
If this cannot be done then is there a way to add this there (baring in mind this will be sent from excel)
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.ReplyRecipients.Add "creditcontrol@dsgibusiness.com"
Item.ReplyRecipients.Item(1).Resolve
Item.Save
End Sub
Thanks Steve