代码之家  ›  专栏  ›  技术社区  ›  Ian R. O'Brien Mamedov

如何设置使用VBA发送的电子邮件的“高度重要性”?

  •  5
  • Ian R. O'Brien Mamedov  · 技术社区  · 14 年前

    objEmail.Importance = 2
    
    objEmail.Configuration.Fields.Item("urn:schemas:mailheader:X-MSMail-Priority") = "High"      ' For Outlook 2003
    
    objEmail.Configuration.Fields.Item("urn:schemas:mailheader:X-Priority") = 2                  ' For Outlook 2003 also
    
    objEmail.Configuration.Fields.Item("urn:schemas:httpmail:importance") = 2
    
    Function Send(sTo As String, sFrom As String, sSubject As String)
        Set objEmail = CreateObject("CDO.Message")
            objEmail.From = sFrom
            objEmail.To = sTo
            objEmail.Subject = sSubject
            objEmail.Textbody = emailBody
            objEmail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "my.smtp.server"
            objEmail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
            // is there a property for high importance, outlook 2007?
            objEmail.Configuration.Fields.Update        
        objEmail.Send
    End Function
    
    3 回复  |  直到 14 年前
        1
  •  10
  •   cheezsteak    10 年前

    我已经有一段时间没有使用Outlook和VBA了,但是我仍然有各种各样的备忘单和链接。我把这个挖出来了;希望有帮助!

    with myEmail
        'can be olImportanceNormal, olImportanceHigh or olImportanceLow
        .Importance = olImportanceNormal
        .Subject = "Subject line"
        .Body = "Body Content"
    end with
    
        2
  •  7
  •   JustoShow    9 年前

        3
  •  0
  •   Simon Adcock    11 年前

    Remou's link 在注释中,这适用于通过VBA的Outlook 2010:

    cdoMessage.Fields.Item(cdoImportance) = cdoHigh  
    
    推荐文章