Automating a Recieve Email command for Outlook 2003 for Pop3 Accounts

  • Thread starter Thread starter Paul Schrader
  • Start date Start date
P

Paul Schrader

Hello All,

Does anyone have a snippet of code that will show how to Code in VB the
retrieve email ? I Need to Automate the retrieval of email for several of
our clients that use Outlook 2003 as they have a tendency to not leave
outlook open, thus tying up space on the server. It is well documented on
how to send and email but I have not been able to locate a way to retrieve
email Programmatically.

Thanks
Paul
 
Does anyone have a snippet of code that will show how to Code in VB the
retrieve email ? I Need to Automate the retrieval of email for several of
our clients that use Outlook 2003 as they have a tendency to not leave
outlook open, thus tying up space on the server. It is well documented on
how to send and email but I have not been able to locate a way to retrieve
email Programmatically.

What exactly do you mean by "retrieving"? You mention a server, so I
assume you're running Exchange; that server will receive e-mail for all
mailboxes whether any Outlook client is running or not.

Naturally, to see the messages Outlook needs to be running.

And what do you mean by "tying up space on the server" when Outlook is
not open? You're not using PST files on your clients, are you?
 
Mike,

What I'm looking for is a way to programmatically execute a retrieve of
email for folks that are not on Exchange servers, so a scheduled task can be
added to retrieve email every 20-30 minutes without having to have Outlook
open. I have this working fine for people that use Outlook Express, but am
having a hard time locating any details on how to complete this for Outlook.

Thanks
Paul
 
Mike,

What I'm looking for is a way to programmatically execute a retrieve of
email for folks that are not on Exchange servers, so a scheduled task can be
added to retrieve email every 20-30 minutes without having to have Outlook
open. I have this working fine for people that use Outlook Express, but am
having a hard time locating any details on how to complete this for Outlook.

Thanks
Paul
[snip]

Maybe the Start method for the SyncObject does what you want. Try this:

Option Explicit
Dim sycs ' As Outlook.SyncObjects
Dim syc ' As Outlook.SyncObject
Dim i ' As Long

Set sycs = CreateObject("Outlook.Application").GetNamespace("MAPI").SyncObjects
For i = 1 To sycs.Count
Set syc = sycs.Item(i)
If MsgBox("Do you wish to synchronize " & syc.Name & "?", vbYesNo + vbQuestion, "MailSync") = vbYes Then
syc.Start
End If
Next
 
Back
Top