Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Email checker

Posted on 2001-06-08
5
Medium Priority
?
184 Views
Last Modified: 2010-05-02
I am trying to create a program that will check for new email every 10 minutes,write the new email to an access database and then delete the message.  
The code I have does most of this except:

It will not check for new messages unless I log off and log on again.
Also it prompts me to select the profile every time, can this be done a automatically.


___Code____
Option Explicit
Dim ws As Workspace
Dim db As Database
Dim rs As Recordset

Private Sub Command5_Click()
MAPISession1.SignOff
Unload Me
End Sub

Private Sub Form_Load()
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("c:\vb\TASKS.MDB")
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
End Sub

Private Sub Timer1_Timer()
MAPIMessages1.FetchUnreadOnly = True
If MAPIMessages1.MsgCount > 0 Then
MAPIMessages1.Fetch
Label1.Caption = MAPIMessages1.MsgCount & " messages in que"
Set rs = db.OpenRecordset("tasks")
rs.AddNew
rs!Date = MAPIMessages1.MsgDateReceived
rs!From = MAPIMessages1.MsgOrigDisplayName
rs!email = MAPIMessages1.MsgOrigAddress
rs!subject = MAPIMessages1.MsgSubject
rs!message = MAPIMessages1.MsgNoteText
rs.Update
MAPIMessages1.Delete
'rs.Close
'Set rs = Nothing
Else
Label1 = ""
End If

End Sub

 
0
Comment
Question by:n_athen
[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
5 Comments
 
LVL 5

Accepted Solution

by:
AndrewDev earned 400 total points
ID: 6168442


1)E-checker: Checks E-mail at Predefined Intervals
http://www.freevbcode.com/ShowCode.Asp?ID=1026

2)This is a calender that runs in the system tray you should be able to pinch the code that does that from it

Regards
Andrew
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6168447
0
 

Author Comment

by:n_athen
ID: 6170950
Thanks but I those programs are far to advanced for me.

Please ignore the request for system tray

I really just need to know what changes I need to make to my code that will have it check for new mail at a set interval.


thanks

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7133464
Hi n_athen,
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 suggest to:

    Accept AndrewDev's comment(s) as an answer.

n_athen, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

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

Expert Comment

by:Computer101
ID: 7167887
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…
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…
Suggested Courses

722 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