从Access 2003升级到Access 2010,代码无法在Outlook 2010中读取电子邮件

时间:2014-04-10 09:40:04

标签: ms-access windows-7 outlook

在Access 2003中,此代码有效。我们升级到Windows 7和Access 2010 / Outlook 2010。

这是原始代码,但我已使用此类网站的推荐对其进行了多次修改。

以下是我的代码中的代码段:

Dim olApp As Outlook.Applicaitoin
Dim Inbox as Outlook.MAPIFolder
Dim InboxItems As OutLook.Items
Dim Mailobject As Object

Set olApp = Outlook.Application
Set myFolder1 = Session.Folders("Public Folders")
Set myFolder2 = myFolder1.Folders("All Public Folders")
Set myFolder3 = myFolder2.Folders("Europe")
Set myFolder4 = myFolder3.Folders("Naples")
Set myFolder5 = myFolder4.Folders("FSSA Naples IT"
Set Inbox = myFolder5.Folders("CDO")

Set InboxItems = Inbox.Items

1 个答案:

答案 0 :(得分:0)

2010年"公共文件夹"是不同的。

设置myFolder1 = Session.Folders("公共文件夹 - NameOfMailboxHere")