【问题标题】:Outlook 2010 Rule to forward emails with attachment at specific timeOutlook 2010 规则在特定时间转发带有附件的电子邮件
【发布时间】:2015-04-08 16:05:55
【问题描述】:

每天,我都会收到包含附件的每小时电子邮件,其主题采用以下格式2014-02-13 emailAlert

是否有规则/VBA 我可以按照forward 这封电子邮件with attachment 自动发送给某人everyday specific time

它应该只在特定时间点转发主题为emailAlertnewest 电子邮件。

如果你们能提供帮助,不胜感激:-)

【问题讨论】:

    标签: vba email outlook


    【解决方案1】:

    您可以在 Outlook 中创建规则,然后分配一个 VBA 宏来转发符合您条件的传入电子邮件。宏子应如下所示:

    public sub test(mail as MailItem)
      ' do whatever you need here
    end sub
    

    mail 对象代表传入的电子邮件。

    MailItem 类的Forward 方法对项目执行转发操作,并将生成的副本作为 MailItem 对象返回。例如,以下示例说明了如何使用 Forward 方法:

    Sub RemoveAttachmentBeforeForwarding()  
      Dim myinspector As Outlook.Inspector  
      Dim myItem As Outlook.MailItem  
      Dim myattachments As Outlook.Attachments 
    
      Set myinspector = Application.ActiveInspector  
      If Not TypeName(myinspector) = "Nothing" Then  
        Set myItem = myinspector.CurrentItem.Forward  
        Set myattachments = myItem.Attachments   
        While myattachments.Count > 0  
          myattachments.Remove 1  
        Wend  
        myItem.Display  
        myItem.Recipients.Add "Eugene Astafiev"  
        myItem.Send  
      Else  
        MsgBox "There is no active inspector."  
      End If 
    End Sub
    

    MailItem 类的DeferredDeliveryTime 属性允许设置一个日期,指示邮件消息的发送日期和时间。

    最后,您可能会发现 Getting Started with VBA in Outlook 2010 文章很有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多