Ana içeriğe atla

Outlook'ta e-posta oluştururken tüm ek adlarını ileti gövdesine nasıl listeleyebilirim?

Outlook'ta bir e-posta oluştururken tüm ek adlarını ileti gövdesine eklemenin iyi bir yolu var mı? Bu yazıda Outlook'ta bu işi nasıl çözeceğimi anlatacağım.

VBA kodu ile e-posta oluştururken tüm ek adlarını mesaj gövdesine listeleyin

Basit bir özellikle e-posta oluştururken tüm ek adlarını mesaj gövdesine listeleyin


VBA kodu ile e-posta oluştururken tüm ek adlarını mesaj gövdesine listeleyin

Lütfen bu görevi tamamlamak için aşağıdaki adımları uygulayın:

1. Basılı tutun ALT + F11 tuşlarını açmak için Uygulamalar için Microsoft Visual Basic pencere.

2. In Uygulamalar için Microsoft Visual Basic pencere, çift tıklama Bu OutlookOturumu itibaren Proje1 (VbaProject.OTM) bölmesini açın ve ardından aşağıdaki kodu kopyalayıp boş modüle yapıştırın.

VBA kodu: Tüm ek adlarını ileti gövdesine listeleyin:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim xMailItem As MailItem
    If Item.Class = olMail Then
        Set xMailItem = Item
        If xMailItem.Attachments.Count > 0 Then
          AddAttachmentNamesToBody
        End If
    End If
    End Sub

3. Sonra tıklamaya devam edin Ekle > modül, aşağıdaki kodu kopyalayıp açılan boş modüle yapıştırın, ekran görüntüsüne bakın:

VBA kodu: Tüm ek adlarını ileti gövdesine listeleyin:

Public Sub AddAttachmentNamesToBody()
    Dim xMailItem As MailItem
    Dim xAttachment As Attachment
    Dim xFileName As String
   Dim xInspector As Outlook.Inspector
    Dim xDoc As Word.Document
    Dim xWdSelection As Word.Selection
    On Error Resume Next
    Set xMailItem = Outlook.ActiveInspector.CurrentItem
    If xMailItem.Attachments.Count = 0 Then
        Exit Sub
    End If
    xFileName = ""
    For Each xAttachment In xMailItem.Attachments
        If xFileName = "" Then
            xFileName = " <" & xAttachment.FileName & "> "
        Else
            xFileName = xFileName & vbCrLf & " <" & xAttachment.FileName & "> "
        End If
    Next xAttachment
    Set xInspector = Outlook.Application.ActiveInspector()
    Set xDoc = xInspector.WordEditor
    Set xWdSelection = xDoc.Application.Selection
    xWdSelection.HomeKey Unit:=wdStory
    xWdSelection.InsertBefore "Attachments: " & vbCrLf & xFileName & vbCrLf & vbCrLf
    Set xMailItem = Nothing
    End Sub

4. Ve sonra tıklayın Tools > Referanslar içinde Uygulamalar için Microsoft Visual Basic pencere, dışarı çıkmış Referanslar-Proje1 iletişim kutusu, işaretleyin Microsoft Word Nesne Kitaplığı seçeneği Mevcut Referanslar liste kutusu, ekran görüntüsüne bakın:

5. tıklayın OK iletişim kutusundan çıkmak için makro düğmesini Hızlı Erişim Araç Çubuğu. Yeni Mesaj pencere seç Daha Komutlar itibaren Hızlı erişim araç çubuğunu özelleştir açılır, ekran görüntüsüne bakın:

6. In Outlook Seçenekleri iletişim kutusunda aşağıdaki işlemleri yapın:

(1.) Seçin Makrolar itibaren Komutları seçin açılır liste;

(2.) Şu anda eklediğiniz makro adına tıklayın;

(3.) Ve sonra tıklayın Ekle makroyu eklemek için düğme Hızlı erişim araç çubuğunu özelleştir.

7. Sonra tıklayın OK iletişim kutusunu kapatmak için, şimdi makro düğmesi Hızlı Erişim Araç Çubuğu, ekran görüntüsüne bakın:

8. Şimdi, yeni bir mesaj oluşturduğunuzda ve makro düğmesini tıkladığınızda, aşağıdaki ekran görüntüsü gibi ek adları mesaj gövdesinin üstüne eklenecektir:


Basit bir özellikle e-posta oluştururken tüm ek adlarını mesaj gövdesine listeleyin

Yukarıdaki kod çok olabilir, eğer varsa, başvurmak sizin için ne kadar zor olabilir? Outlook için Kutools, Onun ile Adları Kopyala özelliği, bir iletinin ek adlarını hızlı bir şekilde kopyalayabilir ve ihtiyacınız olan yere yapıştırabilirsiniz.

Not:Bunu uygulamak için Adları Kopyalaöncelikle Outlook için Kutoolsve ardından özelliği hızlı ve kolay bir şekilde uygulayın.

Kurduktan sonra Outlook için Kutoolslütfen şunu yapın:

1. Öncelikle, lütfen ihtiyacınız olan yeni e-postayı oluşturun ve ardından Kutools > Adları Kopyala yeni Mesaj pencere, ekran görüntüsüne bakın:

2. Ardından, ek adlarının panoya kopyalandığını hatırlatmak için bir komut kutusu açılır, ekran görüntüsüne bakın:

3. Şimdi, sadece basman gerekiyor Ctrl + V ek adlarını ihtiyacınız olan mesaj gövdesine yapıştırmak için tuşları bir araya getirin, ekran görüntüsüne bakın:


Daha ilgili makaleler:

  • Outlook'ta Orijinal Eklerle Tümünü Yanıtla
  • Normalde, Outlook'taki tüm alıcılara iletiyi yanıtlamak için Tümünü Yanıtla işlevini uyguladığınızda, orijinal ekler otomatik olarak kaybolur. Outlook'ta tümüne yanıt verirken orijinal ekler eklemek mümkün müdür?
  • Outlook'tan Ekleri Belirli Bir Klasöre İndir / Kaydet
  • Genel olarak, bir e-postanın tüm eklerini Ekler> Outlook'ta Tüm Ekleri Kaydet'e tıklayarak kaydedebilirsiniz. Ancak, alınan tüm e-postalardaki ve e-postaları alan tüm ekleri kaydetmeniz gerekiyorsa, herhangi bir ideal var mı? Bu makale, ekleri Outlook'tan belirli bir klasöre otomatik olarak indirmek için iki çözüm sunacaktır.
  • Outlook'ta Varsayılan Ek Kaydetme Konumunu Değiştirin
  • Outlook'u her başlattığınızda belirlediğiniz ek konumunu bulmaktan bıktınız mı? Bu eğitimde, size varsayılan ek konumunu nasıl değiştireceğinizi göstereceğiz. Bundan sonra, Outlook'u yeniden başlatsanız bile ekleri her kaydettiğinizde belirtilen ek kaydetme klasörü otomatik olarak açılacaktır.
  • Outlook'ta E-postadan Tüm Ekleri Kaldır
  • Normalde bir e-postayı önizlerken, bir eki sağ tıklayarak silebilir ve Eki Kaldır öğesini seçebilirsiniz. Bazen bir e-posta mesajında ​​birçok ek olabilir ve bunları tek tek kaldırmak sıkıcı olacaktır. Burada, tek bir e-postadaki tüm ekleri kaldırmanız ve Outlook'ta da birden çok e-postadaki tüm ekleri kaldırmanız için sizi iki kolay numara ayarlıyoruz.

En İyi Ofis Üretkenlik Araçları

Outlook için Kutools - Outlook'unuzu Güçlendirecek 100'den Fazla Güçlü Özellik

🤖 AI Posta Yardımcısı: Yapay zeka büyüsüyle anında profesyonel e-postalar: tek tıkla dahice yanıtlar, mükemmel ton, çok dilli ustalık. E-posta göndermeyi zahmetsizce dönüştürün! ...

???? E-posta Otomasyonu: Ofis Dışında (POP ve IMAP için kullanılabilir)  /  E-posta Gönderimini Planla  /  E-posta Gönderirken Kurallara Göre Otomatik CC/BCC  /  Otomatik İletme (Gelişmiş Kurallar)   /  Otomatik Karşılama Ekleme   /  Çok Alıcılı E-postaları Otomatik Olarak Bireysel Mesajlara Bölün ...

📨 E-posta Yönetimi: E-postaları Kolayca Geri Çağırın  /  Dolandırıcılık E-postalarını Konulara ve Diğerlerine Göre Engelleyin  /  Yinelenen E-postaları Silin  /  gelişmiş Arama  /  Klasörleri Birleştir ...

📁 Ekler ProToplu Kaydetme  /  Toplu Ayır  /  Toplu Sıkıştırma  /  Otomatik kaydet   /  Otomatik Ayır  /  Otomatik Sıkıştır ...

🌟 Arayüz Büyüsü: 😊Daha Fazla Güzel ve Havalı Emoji   /  Sekmeli Görünümlerle Outlook Verimliliğinizi Artırın  /  Outlook'u Kapatmak Yerine Küçültün ...

👍 Tek Tıklamayla Harikalar: Tümünü Gelen Eklerle Yanıtla  /   Kimlik Avına Karşı E-postalar  /  🕘Gönderenin Saat Dilimini Göster ...

👩🏼‍🤝‍👩🏻 Kişiler ve Takvim: Seçilen E-postalardan Toplu Kişi Ekleme  /  Kişi Grubunu Bireysel Gruplara Bölme  /  Doğum Günü Hatırlatıcılarını Kaldır ...

üzerinde 100 Özellikler Keşfinizi Bekleyin! Daha Fazlasını Keşfetmek İçin Buraya Tıklayın.

 

 

Comments (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Why am I getting "user-defined type not defined" when I get to Step 8?
This comment was minimized by the moderator on the site
Why am I getting "user-defined type not defined" when I get to Step 8?
This comment was minimized by the moderator on the site
When I do this, it always put the attachments at the beginning of the message, no matter where my cursor is located. I then have to copy/paste to the bottom of the email. Is there a way to change that?
This comment was minimized by the moderator on the site
Hello, VMS,
If you want to put the attachments at the the position of your cursor, please replace the second code with following code:

Public Sub AddAttachmentNamesToBody()

Dim xMailItem As MailItem

Dim xAttachment As Attachment

Dim xFileName As String

Dim xInspector As Outlook.Inspector

Dim xDoc As Word.Document

Dim xWdSelection As Word.Selection

On Error Resume Next

Set xMailItem = Outlook.ActiveInspector.CurrentItem

If xMailItem.Attachments.Count = 0 Then

Exit Sub

End If

xFileName = ""

For Each xAttachment In xMailItem.Attachments

If xFileName = "" Then

xFileName = " <" & xAttachment.FileName & "> "

Else

xFileName = xFileName & vbCrLf & " <" & xAttachment.FileName & "> "

End If

Next xAttachment

Set xInspector = Outlook.Application.ActiveInspector()

Set xDoc = xInspector.WordEditor

Set xWdSelection = xDoc.Application.Selection

xWdSelection.InsertBefore "Attachments: " & vbCrLf & xFileName & vbCrLf & vbCrLf

Set xMailItem = Nothing

End Sub

Please try, hope it can help you!
This comment was minimized by the moderator on the site
That worked! Now another favor... How do I exclude certain file types or names? My required company signature contains a PNG file that I would like to exclude.Thank you!!
This comment was minimized by the moderator on the site
To exclude some specific files, please apply the below code, please try it.
Public Sub AddAttachmentNamesToBody()

Dim xMailItem As MailItem

Dim xAttachment As Attachment

Dim xFileName As String

Dim xInspector As Outlook.Inspector

Dim xDoc As Word.Document

Dim xWdSelection As Word.Selection

Dim xExt As String

Dim xFound As Boolean

Dim xExtArr As Variant

On Error Resume Next

xExtArr = Array("docx", "exe") 'change the file extension you want to exclude

Set xMailItem = Outlook.ActiveInspector.CurrentItem

If xMailItem.Attachments.Count = 0 Then

Exit Sub

End If

xFileName = ""

For Each xAttachment In xMailItem.Attachments

xExt = VBA.Mid(xAttachment.FileName, VBA.InStrRev(xAttachment.FileName, ".") + 1)

xFound = False

For i = LBound(xExtArr) To UBound(xExtArr)

If xExt = xExtArr(i) Then

xFound = True

Exit For

End If

Next

If xFound = False Then

If xFileName = "" Then

xFileName = " <" & xAttachment.FileName & "> "

Else

xFileName = xFileName & vbCrLf & " <" & xAttachment.FileName & "> "

End If

End If

Next xAttachment

Set xInspector = Outlook.Application.ActiveInspector()

Set xDoc = xInspector.WordEditor

Set xWdSelection = xDoc.Application.Selection

xWdSelection.InsertBefore "Attachments: " & vbCrLf & xFileName & vbCrLf & vbCrLf

Set xMailItem = Nothing

End Sub
This comment was minimized by the moderator on the site
when I tried this code it sends the attachment names in every email that has attachments.
I want it to only do it when I click the macro.

How do I amend the code to do just that?
This comment was minimized by the moderator on the site
I also don't know how to fix it. Anyone could hep on that?
This comment was minimized by the moderator on the site
This is wonderful -- thank you! Is there also a way to somehow view all the attachment names in an email that has been sent to you from someone else (i.e. received)? For some reason, the file names are not displaying in full unless you hover, which is ridiculous when you regularly have 15 files to sort through.
This comment was minimized by the moderator on the site
Hello,
To List all attachment names in an received email, please copy and pase the below VBA code into the ThisOutlookSession module of the Microsoft Visual Basic for Applications window:

Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim xEIDArr As Variant, xEID As Variant, xItem As Object
Dim xAttachment As Attachment
Dim xFileName As String
On Error Resume Next
xEIDArr = Split(EntryIDCollection, ",")
For Each xEID In xEIDArr
Set xItem = Session.GetItemFromID(xEID)
If xItem.Class = olMail Then
xFileName = ""
For Each xAttachment In xItem.Attachments
If IsEmbeddedAttachment(xAttachment) = False Then
If xFileName = "" Then
xFileName = " " & "<" & xAttachment.FileName & ">"
Else
xFileName = xFileName & "
" & " " & "<" & xAttachment.FileName & ">"
End If
End If
Next xAttachment
If xFileName = "" Then Exit Sub
xFileName = "Attachments: " & "
" & xFileName & "
" & "
"
xItem.HTMLBody = "" & xFileName & "" & xItem.HTMLBody
xItem.Save
End If
Next
Set xItem = 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

After pasting this code, when new emails with attachments arriving in your Outlook, the attachment names will be listed at the top of the message body automatically.
Please try it, hope it can help you!
This comment was minimized by the moderator on the site
this is great. Is there any way to merge this with VMS's request above to exclude some specific files included in signatures (.png, .jpg, etc.)?
This comment was minimized by the moderator on the site
Great, thanks for that. I wonder if it is possible that the list of attachments is only attached when I write to a specific email address?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations