访问辅助电子邮件帐户中的子文件夹 [英] Access sub folder in secondary email account

查看:67
本文介绍了访问辅助电子邮件帐户中的子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将电子邮件从辅助 Outlook 帐户中的收件箱移动到该帐户中的子文件夹.

I am trying to move emails from the inbox in a secondary Outlook account to a sub-folder in that account.

Sub newBox()
    Dim myInbox As Outlook.Folder
    Dim myDestFolder As Outlook.Folder
    Dim myItems As Outlook.Items
    Dim myItem As Object
    Dim i As Integer

    Set myInbox = Session.Folders("Secondary").Folders("Inbox")
    Set myDestFolder = myInbox.Parent.Folders("Complete")

End Sub

当我尝试设置目的地时,myDestFolder,我得到

When I try to set the destination, myDestFolder, I get

运行时错误,找不到对象.

Run-Time error, An object could not be found.

推荐答案

您将文件夹树从辅助"导航到收件箱",然后返回到辅助"myInbox.Parent.

You navigated the folder tree from Secondary to Inbox then back to myInbox.Parent which is Secondary.

在您的回答帖子中,您更改为

In your answer post you changed to

Set myDestFolder = Session.Folders("Secondary").Folders("Inbox").Folders("Complete")

这表示 Complete 文件夹位于收件箱下方.

This indicates the Complete folder is immediately under the Inbox.

Sub newBox()

    Dim myInbox As Folder
    Dim myDestFolder As Folder

    Set myInbox = Session.Folders("Secondary").Folders("Inbox")
    Set myDestFolder = myInbox.Folders("Complete")

End Sub

这篇关于访问辅助电子邮件帐户中的子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆