AllExperts > Experts 
Search      

VB.NET

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More VB.NET Answers
Question Library

Ask a question about VB.NET
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Syed Rizwan Muhammad Rizvi
Expertise
I can answers questions regarding web based and desktop based programming in VB.Net. Which can include SOAP, XML, Custom Controls, COM Interoperability etc.

Experience
Have been working in this specific area for last 2 years previously I was a VB 6 Developer with experties in other languages as well. Total 10 years of programming experience.

 
   

You are here:  Experts > Computing/Technology > Basic > VB.NET > Outlook Sent Items or Outbox

Topic: VB.NET



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



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.