Outlook) (MailItem.Forward 方法
執行專案的 Forward 動作,並以 MailItem 物件傳回產生的複本。
語法
expression。 Forward
表達 代表 MailItem 物件的 變數。
傳回值
MailItem 物件,代表新的郵件項目。
範例
這個 Visual Basic for Applications (VBA) 範例會使用 Remove 方法,在將郵件傳送給 Dan Wilson 之前,先從轉寄的郵件中移除所有附件。 若要執行此範例,請將 'Dan Wilson' 取代成有效的收件者名稱,並在使用中視窗內開啟至少包含一個附件的郵件項目。
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 "Dan Wilson"
myItem.Send
Else
MsgBox "There is no active inspector."
End If
End Sub
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應