メインコンテンツへスキップ

Outlookで元の添付ファイルを使用してすべてに返信するにはどうすればよいですか?

通常、[すべて返信]機能を適用してOutlookのすべての受信者にメッセージを返信すると、元の添付ファイルは自動的に失われます。 Outlookで全員に返信するときに、元の添付ファイルを添付することはできますか?

VBAコードを含む元の添付ファイルですべてに返信する

Outlook用Kutoolsを使用して元の添付ファイルですべてに返信する


VBAコードを含む元の添付ファイルですべてに返信する

Outlookでこのタスクを処理する直接的な機能はありませんが、次のVBAコードを適用してそれを実現できます。 以下の手順で実行してください。

1。 Outlookを起動し、 Alt + F11 キーを押して アプリケーション向け Microsoft Visual Basic 窓。

2。 の中に アプリケーション向け Microsoft Visual Basic ウィンドウ、ダブルクリック このOutlookSession Project1(VbaProject.OTM) ペインでモードを開き、次のコードをコピーして空のモジュールに貼り付けます。

VBAコード:元のahhachmentsですべてに返信します:

Sub ReplyAllWithAttachments()
'Updateby Extendoffice
Dim xItem As Object
On Error Resume Next
Select Case TypeName(Outlook.Application.ActiveWindow)
Case "Explorer"
For Each xItem In Outlook.Application.ActiveExplorer.Selection
GetReplyItem xItem
Next
Case "Inspector"
Set xItem = Outlook.Application.ActiveInspector.CurrentItem
GetReplyItem xItem
End Select
Set xItem = Nothing
End Sub
Sub GetReplyItem(Item As Object)
Dim xReplyMailItem As Outlook.MailItem
On Error Resume Next
If Not Item Is Nothing Then
Set xReplyMailItem = Item.ReplyAll
GetAttachments Item, xReplyMailItem
xReplyMailItem.Display
'xReplyMailItem.Send
Item.UnRead = False
End If
Set xReplyMailItem = Nothing
End Sub
Sub GetAttachments(xSourceItem, xTargetItem)
Dim xFSO As Scripting.FileSystemObject
Dim xTmpPath As String
Dim xAttachment As Attachment
Dim xTmpFile As String
On Error Resume Next
Set xFSO = New Scripting.FileSystemObject
xTmpPath = CreateObject("shell.Application").NameSpace(5).self.Path & "\TmpAttachments\"
If xFSO.FolderExists(xTmpPath) = False Then
MkDir xTmpPath
End If
For Each xAttachment In xSourceItem.Attachments
If IsEmbeddedAttachment(xAttachment) = False Then
xTmpFile = xTmpPath & xAttachment.FileName
xAttachment.SaveAsFile xTmpFile
xTargetItem.Attachments.Add xTmpFile, , , xAttachment.DisplayName
xFSO.DeleteFile xTmpFile
End If
Next
If xFSO.FolderExists(xTmpPath) Then
Kill xTmpPath
End If
Set xFSO = Nothing
End Sub
Function IsEmbeddedAttachment(Attach As Attachment)
Dim xAttParent As Object
Dim xCID As String, xID As String
Dim xHTML As String
On Error Resume Next
Set xAttParent = Attach.Parent
xCID = ""
xCID = Attach.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001F")
If xCID <> "" Then
xHTML = xAttParent.HTMLBody
xID = "cid:" & xCID
If InStr(xHTML, xID) > 0 Then
IsEmbeddedAttachment = True
Else
IsEmbeddedAttachment = False
End If
End If
End Function

ドキュメント 添付ファイル 1 をすべて添付して返信します

3。 そして、 ツール > 参考文献 セクションに アプリケーション向け Microsoft Visual Basic 飛び出した窓 参考資料-Project1 ダイアログボックス、チェック Microsoftスクリプトランタイム オプションから 利用可能な参考文献 リストボックス、スクリーンショットを参照:

ドキュメント 添付ファイル 9 をすべて添付して返信します

4。 次に、コード ウィンドウを保存して閉じると、マクロ ボタンを クイックアクセスツールバー.

5。 添付ファイル付きですべて返信したいメールを開きます メッセージ ウィンドウで選択します その他のコマンド クイックアクセスツールバーをカスタマイズする ドロップダウン、スクリーンショットを参照してください:

ドキュメント 添付ファイル 2 をすべて添付して返信します

6。 の中に Outlookのオプション ダイアログボックスで、次の操作を実行します。

(1.)選択 マクロ からのコマンドを選択 ドロップダウンリスト;

(2.) 今挿入したマクロ名をクリックします。

(3.)次にクリック Add ボタンをクリックしてマクロを追加します クイックアクセスツールバーをカスタマイズする.

ドキュメント 添付ファイル 3 をすべて添付して返信します

7。 次に、をクリックします OK ダイアログ ボックスを閉じるには、マクロ ボタンが クイックアクセスツールバー、スクリーンショットを参照してください:

ドキュメント 添付ファイル 4 をすべて添付して返信します

8。 次に、マクロ ボタンをクリックすると、元の添付ファイルを含む返信メッセージ ウィンドウが開き、返信メッセージを作成して、 送信 ボタン、スクリーンショットを参照してください:

ドキュメント 添付ファイル 5 をすべて添付して返信します


Outlook用Kutoolsを使用して元の添付ファイルですべてに返信する

あなたが持っている場合 Kutools for Outlookそのと 添付ファイルですべて返信 機能を使用すると、ワンクリックですべての添付ファイルに返信できます。

Kutools for Outlook : 100以上の便利なOutlookアドインがあり、60日以内に制限なしで無料で試すことができます. 

インストールした後 Kutools for Outlook、次のようにしてください。

1。 すべて添付ファイル付きで返信したいメッセージを選択し、[クリック] をクリックします。 クツール > 添付ファイルで返信 > 添付ファイルですべて返信、スクリーンショットを参照してください:

2。 元の添付ファイルを含む返信メッセージ ウィンドウが開き、メッセージを作成して送信します。スクリーンショットを参照してください。

ドキュメント 添付ファイル 7 をすべて添付して返信します

クリックして、Kutools for Outlookと無料トライアルを今すぐダウンロードしてください!


最高のオフィス生産性向上ツール

Kutools for Outlook - Outlook を強化する 100 以上の強力な機能

🤖 AIメールアシスタント: AI の魔法を備えたインスタント プロのメール - ワンクリックで天才的な返信、完璧な口調、多言語の習得。メールを簡単に変革しましょう! ...

📧 自動メール: 不在時 (POP および IMAP で利用可能)  /  メール送信のスケジュール設定  /  メール送信時のルールによる自動CC/BCC  /  自動転送 (高度なルール)   /  あいさつを自動追加   /  複数受信者の電子メールを個別のメッセージに自動的に分割する ...

📨 電子メール管理: メールを簡単に思い出す  /  件名などで詐欺メールをブロック  /  重複するメールを削除する  /  高度な検索  /  フォルダーを統合する ...

📁 アタッチメント プロバッチ保存  /  バッチデタッチ  /  バッチ圧縮  /  自動保存   /  自動デタッチ  /  自動圧縮 ...

🌟 インターフェースマジック: 😊もっと可愛くてクールな絵文字   /  タブ付きビューで Outlook の生産性を向上  /  Outlook を閉じる代わりに最小化する ...

???? ワンクリックの驚異: 受信した添付ファイルをすべてに返信する  /   フィッシングメール対策  /  🕘送信者のタイムゾーンを表示 ...

👩🏼‍🤝‍👩🏻 連絡先とカレンダー: 選択したメールから連絡先を一括追加  /  連絡先グループを個別のグループに分割する  /  誕生日のリマインダーを削除する ...

オーバー 100の特長 あなたの探索をお待ちしています! ここをクリックして詳細をご覧ください。

 

 

Comments (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Is it possible that, after a reboot or windows update, the macro is not working anymore? Also after doing again the procedure is not working anymore
This comment was minimized by the moderator on the site
Bonjour, la macro n'a fonctionné qu'une seule fois, dommage
This comment was minimized by the moderator on the site
Bonjour, nickel, mais n'a fonctionné qu'une fois. dommage
This comment was minimized by the moderator on the site
BonjourCette macros est super malheureusement cela ne fonctionne qu'une fois.. dommage
This comment was minimized by the moderator on the site
is there a macro that replies to all keeps attachments and keeps the original email in text format?
This comment was minimized by the moderator on the site
Thank you very much, you are the only one to share this macro and it's awesome, thank you for your work !
This comment was minimized by the moderator on the site
a macro VBA só funciona por um dia?
This comment was minimized by the moderator on the site
Bonjour,


Super, ça marche à merveille. J'ai visité plein de tuto et d'échange sur le sujet et aucune réponse satisfaisante avant celui-ci. Sachant que jusqu'à présent, je bricolais toujours entre "transférer" et remettre les destinataires ou "répondre à tous" et remettre la ou les pièces jointes. Encore merci.

Harivola
This comment was minimized by the moderator on the site
All files in mail adding as attachment such as image in my signiture.
How can i only attachment files
This comment was minimized by the moderator on the site
Hi,
If you need to exclude the images within the messages which are inserted into the attachments, please apply the below VBA code, hope it can help you!
Sub ReplyAllWithAttachments()
Dim xItem As Object
On Error Resume Next
Select Case TypeName(Outlook.Application.ActiveWindow)
Case "Explorer"
For Each xItem In Outlook.Application.ActiveExplorer.Selection
GetReplyItem xItem
Next
Case "Inspector"
Set xItem = Outlook.Application.ActiveInspector.CurrentItem
GetReplyItem xItem
End Select
Set xItem = Nothing
End Sub
Sub GetReplyItem(Item As Object)
Dim xReplyMailItem As Outlook.MailItem
On Error Resume Next
If Not Item Is Nothing Then
Set xReplyMailItem = Item.ReplyAll
GetAttachments Item, xReplyMailItem
xReplyMailItem.Display
'xReplyMailItem.Send
Item.UnRead = False
End If
Set xReplyMailItem = Nothing
End Sub
Sub GetAttachments(xSourceItem, xTargetItem)
Dim xFSO As Scripting.FileSystemObject
Dim xTmpPath As String
Dim xAttachment As Attachment
Dim xTmpFile As String
On Error Resume Next
Set xFSO = New Scripting.FileSystemObject
xTmpPath = CreateObject("shell.Application").NameSpace(5).self.Path & "\TmpAttachments\"
If xFSO.FolderExists(xTmpPath) = False Then
MkDir xTmpPath
End If
For Each xAttachment In xSourceItem.Attachments
If IsEmbeddedAttachment(xAttachment) = False Then
xTmpFile = xTmpPath & xAttachment.FileName
xAttachment.SaveAsFile xTmpFile
xTargetItem.Attachments.Add xTmpFile, , , xAttachment.DisplayName
xFSO.DeleteFile xTmpFile
End If
Next
If xFSO.FolderExists(xTmpPath) Then
Kill xTmpPath
End If
Set xFSO = Nothing
End Sub
Function IsEmbeddedAttachment(Attach As Attachment)
Dim xAttParent As Object
Dim xCID As String, xID As String
Dim xHTML As String
On Error Resume Next
Set xAttParent = Attach.Parent
xCID = ""
xCID = Attach.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001F")
If xCID <> "" Then
xHTML = xAttParent.HTMLBody
xID = "cid:" & xCID
If InStr(xHTML, xID) > 0 Then
IsEmbeddedAttachment = True
Else
IsEmbeddedAttachment = False
End If
End If
End Function
This comment was minimized by the moderator on the site
I signed up just to say thank you! Skyyang.
This comment was minimized by the moderator on the site
Thanks alot
This comment was minimized by the moderator on the site
Getting compile error as : User-define type not defined at line no " Dim xFSO As Scripting.FileSystemObject" under "Sub GetAttachments(xSourceItem, xTargetItem)"
Kindly Advice on this error.
This comment was minimized by the moderator on the site
Hello, Sam,
Sorry, the article misses the step 3, I have updated this article, please try again. Hope it can help you!

Thank you for your reminder.
This comment was minimized by the moderator on the site
Thank you so much skyyang!!

Works like a charm.

Best Regards
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations