Accessing contents of InBox (doesn't work since new personal folders were added)

  • Thread starter Thread starter Alan Silver
  • Start date Start date
A

Alan Silver

Hello,

I hope someone can help with this. I've searched Google but not found
any answer.

I have a VB case management application which runs as a client
application against an SQL server. One of the tasks is that the user can
log receipt of an e-mail. I do this by showing a list of all e-mails in
their InBox and allowing them to choose one, along with any attachments
it may have. The details of the e-mail, body text and attachments are
then saved to a central server. The relevant code for reading the InBox
is (simplified) :-

Dim omOutlook As Outlook.Application
Dim omInBox As Outlook.MAPIFolder
Dim olMailItem 'As Outlook.MailItem
Dim nlRow As Long

Set omOutlook = New Outlook.Application
Set omInBox = omOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
For nlRow = 1 To omInBox.Items.Count
With omInBox.Items(nlRow)
' add e-mail details to display grid
End With
Next

Now this was working fine for ages. Just recently, they experienced
problems with Outlook and the system Admin set up new personal folders
for all of them. Since then, whenever they try to log an e-mail, the
list is empty. Despite having e-mails in the InBox, nothing shows up in
the list.

So, any ideas how to get around this ? Any advice appreciated.
 
Alan-

Have you sat down at one of these workstations and check the settings for
the Personal folder to see where it is actually pointing to? If the admin
created New personal folders and nothing is pointing to them, the
olFolderInbox constant isn't going where the data is. I'd verify where the
mail is being delivered to first of all, then add logic to check dates of
messages or give a dropdown to select where to get them from. Right now it's
only going to look in the Default Inbox based upon this line in your code:

Set omInBox = omOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)

HTH

Matt


"Alan Silver"
 
Matt Williamson said:
Have you sat down at one of these workstations and check the settings
for the Personal folder to see where it is actually pointing to? If the
admin created New personal folders and nothing is pointing to them, the
olFolderInbox constant isn't going where the data is. I'd verify where
the mail is being delivered to first of all,

The mail is coming in to the InBox in the new personal folders.
then add logic to check dates of messages or give a dropdown to select
where to get them from. Right now it's only going to look in the
Default Inbox based upon this line in your code:

Set omInBox =
omOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)

I only want to look in the default InBox. At this stage I don't want to
allow them to look in any other folders.

Thanx for the reply, any further help would be appreciated.
 
Back
Top