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

Outlookで選択したメールの添付ファイルの情報のリストを取得するにはどうすればよいですか?

添付ファイルが添付された受信メールの場合、表示名やファイル名など、添付ファイルの詳細情報が必要になる場合があります。 実際、VBAコードを使用すると、Outlookで現在選択されている電子メールの添付ファイルの情報のリストを簡単に取得できます。 詳細については、以下のチュートリアルを参照してください。

Outlookで選択したメールの添付ファイルの情報のリストを取得する

Office タブ - Microsoft Office でタブによる編集と参照を有効にし、仕事をスムーズにします
Kutools for Outlook - 100 以上の高度な機能で Outlook を強化し、優れた効率を実現します
これらの高度な機能を使用して、Outlook 2021 ~ 2010 または Outlook 365 を強化します。 包括的な 60 日間の無料トライアルを利用して、メール エクスペリエンスを向上させてください。

矢印青い右バブルOutlookで選択したメールの添付ファイルの情報のリストを取得する

1.情報を取得したい添付ファイル付きの電子メールを選択します。

2。 プレス 他の + F11 キーボードのキーを押して アプリケーション向け Microsoft Visual Basic 窓。

3.次に、 Project1 > MicrosoftOutlookオブジェクト > このOutlookSession を開く Project1 – ThisOutlookSession 窓。 スクリーンショットを参照してください:

4.次に、以下のVBAコードをコピーしてProject1 –ThisOutlookSessionウィンドウに貼り付けます。

VBAコード:添付ファイルの情報のリストを取得します

Option Explicit
Public Sub GetAttachmentList()
    Dim selItem As Object
    Dim aMail As MailItem
    Dim aAttach As attachment
    Dim Report As String
    
    For Each selItem In Application.ActiveExplorer.Selection
        If selItem.Class = olMail Then
            Set aMail = selItem
            For Each aAttach In aMail.Attachments
                Report = Report & vbCrLf & "------------------------------------------------------------------------" & vbCrLf
                Report = Report & GetAttachmentInfo(aAttach)
            Next
            Call CreateReportEmail("Attachment Report", Report)
        End If
    Next
End Sub
 
Public Function GetAttachmentInfo(attachment As attachment)
    Dim Report
    GetAttachmentInfo = ""
    Report = Report & "Index: " & attachment.Index & vbCrLf
    Report = Report & "Display Name: " & attachment.DisplayName & vbCrLf
    Report = Report & "File Name: " & attachment.FileName & vbCrLf
    Report = Report & "Block Level: " & attachment.BlockLevel & vbCrLf
    Report = Report & "Path Name: " & attachment.PathName & vbCrLf
    Report = Report & "Position: " & attachment.Position & vbCrLf
    Report = Report & "Size: " & attachment.Size & vbCrLf
    Report = Report & "Type: " & attachment.Type & vbCrLf
    
    GetAttachmentInfo = Report
End Function
Sub CreateReportEmail(Title As String, Report As String)
    Dim aMail As MailItem
    
    Set aMail = Application.CreateItem(olMailItem)
        
    aMail.Subject = Title
    aMail.Body = Report
    
    aMail.Display
End Sub 

5。 押す F5 キーボードのキーを押して、VBAコードを実行します。

6.今 マクロ ダイアログボックスが表示されたら、をクリックしてください ラン

7。 をクリックすると ラン ボタンの マクロ ダイアログボックスでは、選択した電子メールのすべての添付ファイル情報が電子メール本文内にリストされた新しいメッセージウィンドウが作成されます。 スクリーンショットを参照してください:

Note:このVBAコードは、Outlook 2007、2010、および2013に適用できます。


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

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

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

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

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

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

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

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

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

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

 

 

Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi - I'm trying to figure out a way to set an automatic response which lists all the attachments they have sent. If this can include a file index for folders that would also be brilliant.


Basically - we receive emails with document submissions, I already have an automatic response set up to thank them for their submission but if this could now include "the documents you submitted are as below:... etc" that would help massively.


If somebody could help with this that would be brilliant! Thanks!
This comment was minimized by the moderator on the site
Hello. can you imagine any possibility to fetch/open a specific attachment directly from your list (e.g. a link embedded). Thank You in advance Sandra
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations