2017-10-09 62 views
0

我已經在Excel中創建了一個用於發送郵件的宏。使用Excel的信封時設置郵件的重要性

我想將重要性設置得很高。我試過

.Importance = 2 
.olImportanceHigh = 2 
.Importance = olImportanceHigh 

它說對象不支持屬性或方法。

ws1.Activate 
    ToArray = wb1.Sheets("Report").Cells(3, 34).Value 
    CCArray = wb1.Sheets("Report").Cells(3, 35).Value 
    Subject = subject1 
    Content = wb1.Sheets("Report").Cells(3, 36).Value 
    ws1.Range("B3:P31").Select 
    ActiveWorkbook.EnvelopeVisible = True 
    With wb1.Sheets("New Report").MailEnvelope 
    .Introduction = Content 
    .Item.To = ToArray 
    .Item.CC = CCArray 
    .Item.Subject = Subject 
    .Item.attachments.Add (wb2.FullName) 
    .Importance = olImportanceHigh 
    .Item.Send 
End With 
Application.DisplayAlerts = False 

回答

4

這是的MailItem的屬性,而不是MailEnvelope,所以你需要使用:

.Item.Importance = 2 
1

工作表的「MailEnvelope」屬性返回MsoEnvelope對象。 「重要性」是的MailItem對象的屬性,所以你需要:

.Item.Importance = 2 
1

您是否嘗試過?

.Item.Importance = olImportanceHigh 
相關問題