I have a webpage with a button that sends an email on the page to the email recipient. We are currently using Lotus Notes and a VB script, we can create a Lotus Notes object, and one of the properties of this object is PutInFolder. After the user clicks on the email button, the script will send an email and also save the email in a specific folder on the user's computer. Now our company is switching to Outlook 2007, and instead I want to do the same with the Outlook object. Our development is just a local intranet, and there are only a few users who will have access to this. Anyway, my problem is that I cannot find the same functionality with Outlook Application.
I have an email sending that currently works using this logic. Does anyone have any ideas on how to save email in a user's Outlook folder? I tried to find a list of properties that I can name, but I cannot find anything that can be found. Perhaps I do not have the correct check in the search results.
Thank.
sub send_mailvb(sendto, sendcc, sendbcc, subject_text, body_text, attachment1, attachment2, attachment3)
'Open mail, adress, attach report
dim objOutlk 'Outlook
dim objMail 'Email item
dim strMsg
const olMailItem = 0
'Create a new message
set objOutlk = createobject("Outlook.Application")
set objMail = objOutlk.createitem(olMailItem)
' Setup send to
objMail.To = sendto
' Setup send cc
If sendcc <> "" Then
objMail.cc = sendcc
End If
' Setup send bcc
If sendbcc <> "" Then
objMail.bcc = sendbcc
End If
'Set up Subject Line
objMail.subject = subject_text
'Add the body
strMsg = body_text & vbcrlf
'Add an attachments
If attachment1 <> "" Then
objMail.attachments.add(attachment1)
End If
If attachment2 <> "" Then
objMail.attachments.add(attachment2)
End If
If attachment3 <> "" Then
objMail.attachments.add(attachment3)
End If
objMail.body = strMsg
objMail.display 'Use this to display before sending, otherwise call objMail.Send to send without reviewing
'Clean up
set objMail = nothing
set objOutlk = nothing
End Sub
source
share