Hi
I have a macro that asks me if I wan to send an email without saving it to 'sent items' that's fine I added a bit of code to save the email to a C:\ drive, it saves fine BUT when you open it from the c:\ it thinks the message has not been sent.
I tried another way by creating a separate VB script to compose and send the email then saving it but same tinnk.
Is there a way to save a an email to c:\ as a sent item or is there a way to identify the last email that has been sent and pick it out from the send items folder without having to write a script to loop through the send item folder ?
Please see scripts below
I would be grateful for any suggestions/assistance and would prefer to get the second method working but will be happy with either
Outlook macro as described above
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim intRes As Integer
Dim strMsg As String
Dim bullet
Dim response
bullet = Chr(10) & " " & Chr(149) & " "
Do
response = InputBox("Send options" & Chr(10) & bullet & "1.) Send - no keep" & bullet & "2.) Send - keep" & bullet & "0.) Quit" & Chr(10), "Send email options", 1)
If IsNumeric(response) And response < 3 Then Exit Do 'Detect value response.
MsgBox "You must enter a numeric value between 0 and 2.", 48, "Invalid Entry"
Loop
If response = 0 Then
Cancel = True
Else
If Item.Class = olMail Then
If response = 1 Then
Item.DeleteAfterSubmit = True
End If
End If
Item.SaveAs "C:\MySentMessage.msg"
End If
End Sub
VB Macro as described above
Set MyApp = CreateObject("Outlook.Application")
Set MyItem = MyApp.CreateItem(0)
Dim T_O
call Recp
With MyItem
.To = T_O
.Subject = "testSubject"
.ReadReceiptRequested = False
.HTMLBody = "Test"
End With
MyItem.Send
MyItem.Display
MyItem.SaveAs "C:\MySentMessage.msg"', olmsg
Public suB Recp()
T_O= "me@myemail.com"
end Sub
I have a macro that asks me if I wan to send an email without saving it to 'sent items' that's fine I added a bit of code to save the email to a C:\ drive, it saves fine BUT when you open it from the c:\ it thinks the message has not been sent.
I tried another way by creating a separate VB script to compose and send the email then saving it but same tinnk.
Is there a way to save a an email to c:\ as a sent item or is there a way to identify the last email that has been sent and pick it out from the send items folder without having to write a script to loop through the send item folder ?
Please see scripts below
I would be grateful for any suggestions/assistance and would prefer to get the second method working but will be happy with either
Outlook macro as described above
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim intRes As Integer
Dim strMsg As String
Dim bullet
Dim response
bullet = Chr(10) & " " & Chr(149) & " "
Do
response = InputBox("Send options" & Chr(10) & bullet & "1.) Send - no keep" & bullet & "2.) Send - keep" & bullet & "0.) Quit" & Chr(10), "Send email options", 1)
If IsNumeric(response) And response < 3 Then Exit Do 'Detect value response.
MsgBox "You must enter a numeric value between 0 and 2.", 48, "Invalid Entry"
Loop
If response = 0 Then
Cancel = True
Else
If Item.Class = olMail Then
If response = 1 Then
Item.DeleteAfterSubmit = True
End If
End If
Item.SaveAs "C:\MySentMessage.msg"
End If
End Sub
VB Macro as described above
Set MyApp = CreateObject("Outlook.Application")
Set MyItem = MyApp.CreateItem(0)
Dim T_O
call Recp
With MyItem
.To = T_O
.Subject = "testSubject"
.ReadReceiptRequested = False
.HTMLBody = "Test"
End With
MyItem.Send
MyItem.Display
MyItem.SaveAs "C:\MySentMessage.msg"', olmsg
Public suB Recp()
T_O= "me@myemail.com"
end Sub