| |
You are here: Experts > Computing/Technology > Basic > VB.NET > Outlook Sent Items or Outbox
Expert: Syed Rizwan Muhammad Rizvi
Date: 9/3/2008
Subject: Outlook Sent Items or Outbox
Question Hi Syed
Thanks for taking the time to respond to this question.
I have implemented the emailing of spreadsheets using a macro linked to a button in Excel 2003, using Microsoft Outlook 2003. My code looks something like this:
Set objOutlook = CreateObject("outlook.application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.Subject = Register_Name
.Body = "Register:" & vbNewLine & vbNewLine & Register_Name
.To = primary
.cc = C_C
path = path & "\" & filename_ & ".xls"
.NoAging = True
.Attachments.Add (path)
.Display
'.Send
End With
This code is used on a daily basis by my collegues. What I want to implement is a way to check if a user, once having pressed the 'email spreadsheet' button, has indeed actually sent the email.
A message may be displayed or inserted in the spreadsheet telling the user something like "you attempted to send this message on " & a date.
But even better, if i could obtain a list of mail items waiting in Outlook's 'outbox' to be sent, or from Outlook's 'sent items'. Thus, even though the user may think he's emailed, there in plain sight will be a warning informing the user that he has not yet sent the email.
I'm sure it can be done, I'm just not sure how. I'd appreciate some assistance in explaining how manipulation of the folders in Outlook is acheived, and how to get a list of the mail items in those folders.
This is, I guess, a combination Outlook-Excel question, so if not in your area of expertise, is it possible to point me in the right direction?
Kind regards
Shawn
Answer I know I could have answered this more accurately, but all in the name of learning and saving me a bit of time if you go through this link: http://msdn.microsoft.com/en-us/library/ms268893(VS.80).aspx it help you understand the Outlook object model and how to traverse through folders and items inside it.
regards,
Rizwan
Add to this Answer
Ask a Question
|
|