Solved

Outlook constrol

Posted on 2002-06-03
11
177 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now