Solved

Outlook constrol

Posted on 2002-06-03
11
186 Views
Last Modified: 2010-05-02
Hi

I want to make an application will be contected to my Outlook (running on the same PC), and will notify me when a reminder is pop up or I'm receiving an email

Is there such a control ?
Do you know a way I can do that ?

0
Comment
Question by:lirong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +4
11 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7050880
??? can you clarify, please
Because, Outlook has already some "notification" possiblities for new mail:
* sound (check control panel, sound, find "new mail notification", choose sound file)
* mouse cursor change
* start program (you must define a rule for this)
For reminder, there is a message box for the reminders.

What do you need what outlook doesn't have?
0
 

Author Comment

by:lirong
ID: 7050889
OK. I want to create an application that will "listen and see" the Outlook's data. If, for example I'll recieve an email, my application will know that and will do something.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7050894
2 options:
* constantly running application
let your application get the instance of the running outlook, and getting it's events:
'in a form (or class module)
public withevents appOutlook as Outlook.Application
'you can now get some events from outlook, for example NewMail

* let your application be started by outlook's rule (see previous comment)

CHeers
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:vbDoc
ID: 7051412
I have done this many times with MAPI. There is a great souce for this a www.planetsourcecode.com. Just search for 'Mapi Read Outlook' under the Visual Basic section.
Regards
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7051634
<offtopic>
nice resume vbdoc, SP section the better
</offtopic>
0
 
LVL 2

Expert Comment

by:vbDoc
ID: 7051645
<offtopic>
Thanks, I get a lot of comments on it.
</offtopic>
0
 
LVL 5

Accepted Solution

by:
thenrich earned 150 total points
ID: 7051896
here is a code snipet i use in conjuction with outlook and a timer :

Option Explicit
Dim temp As Variant
Dim tmTime As Variant
Dim OutLookapp As Outlook.Application
Dim OutLookNS As Outlook.NameSpace
Dim Sentfldr As Outlook.MAPIFolder
Dim Deletefldr As Outlook.MAPIFolder
Dim InBoxfldr As Outlook.MAPIFolder
Dim MyItems As Outlook.Items
Dim Coll As Collection

Dim TempPath As String
Dim i As Integer
Dim i2 As Integer
Dim NewMsg As Outlook.MailItem
Dim wCount As Integer
Dim iCount As Integer
Dim coName As String
Private Sub cmdCancel_Click()
   Unload Me
End Sub


Private Sub Form_Load()
     Set OutLookapp = GetObject(, "OutLook.Application")
End Sub

Private Sub Timer1_Timer()
     
     For i = 0 To 975
        lblMessage.Width = i
     Next
         
    '' Associates variable to NameSpace
       Set OutLookNS = OutLookapp.GetNamespace("MAPI")

    '' Associates variable to an OutLook folders
       Set Sentfldr = OutLookNS.GetDefaultFolder(olFolderSentMail)
       Set Deletefldr = OutLookNS.GetDefaultFolder(olFolderDeletedItems)
       Set MyItems = OutLookNS.GetDefaultFolder(olFolderInbox).Items
       Set Coll = New Collection
       
        For i = 1 To MyItems.Count
           temp = Left(Trim(MyItems(i).Subject), 5)
           temp = Left(Trim(MyItems(i).Subject), 9)
           If Left(Trim(MyItems(i).Subject), 5) = "Read:" Or _
           Left(Trim(MyItems(i).Subject), 9) = "Not read:" Then
              Coll.Add MyItems(i)
           End If
        Next
               
        For i = 1 To Coll.Count
           Coll.Item(i).Delete
        Next
       
        If Sentfldr.Items.Count > 0 Then PB1.Max = Sentfldr.Items.Count
        For i = 1 To Sentfldr.Items.Count
           Sentfldr.Items(1).Delete
           PB1.Value = i
        Next
        PB1.Value = 0
        PB1.Refresh
       
        If Deletefldr.Items.Count > 0 Then PB1.Max = Deletefldr.Items.Count
        For i = 1 To Deletefldr.Items.Count
           Deletefldr.Items(1).Delete
           PB1.Value = i
        Next
        PB1.Refresh
        PB1.Value = 0
       
  lblMessage.Width = 0
  lblMessage.Refresh
End Sub
0
 

Author Comment

by:lirong
ID: 7065137
Will it work on reminders as well as incomming emails ?
0
 

Author Comment

by:lirong
ID: 7065161
What is PB1 ???
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7851440
Hi lirong,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: angelIII and thenrich

lirong, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7913033
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

angelIII points for you at:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20506490.html
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question