Solved

Outlook constrol

Posted on 2002-06-03
11
179 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
  • 3
  • 2
  • 2
  • +4
11 Comments
 
LVL 142

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 142

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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

786 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