Solved

Outlook constrol

Posted on 2002-06-03
11
176 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

746 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

13 Experts available now in Live!

Get 1:1 Help Now