Skip to main content

Conas gach ainm ceangail a liostáil i gcorp teachtaireachta agus ríomhphost á chumadh in Outlook?

An bhfuil aon bhealaí maithe ann dúinn gach ainm iatáin a chur isteach i gcorp na teachtaireachta agus ríomhphost á chumadh in Outlook? An t-alt seo, labhróidh mé faoi conas an post seo a réiteach in Outlook.

Liostaigh gach ainm ceangail i gcorp na teachtaireachta agus tú ag cumadh ríomhphoist le cód VBA

Liostaigh gach ainm ceangail i gcorp na teachtaireachta agus tú ag cumadh ríomhphoist le gné shimplí


Liostaigh gach ainm ceangail i gcorp na teachtaireachta agus tú ag cumadh ríomhphoist le cód VBA

Déan na céimeanna seo a leanas le do thoil chun an tasc seo a chríochnú:

1. Coinnigh síos an ALT + F11 eochracha a oscailt Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

2. Sa an Microsoft Visual Basic d’Fheidhmchláir fuinneog, cliceáil dúbailte ThisOutlookSession ó na Tionscadal1 (VbaProject.OTM) pána chun an modh a oscailt, agus ansin an cód seo a leanas a chóipeáil agus a ghreamú isteach sa mhodúl bán.

Cód VBA: Liostaigh gach ainm ceangail i gcorp na teachtaireachta:

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. Ansin téigh ar cliceáil Ionsáigh > Modúil, cóipeáil agus greamaigh an cód thíos sa mhodúl bán oscailte, féach an pictiúr:

Cód VBA: Liostaigh gach ainm ceangail i gcorp na teachtaireachta:

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. Agus ansin cliceáil uirlisí > tagairtí sa Microsoft Visual Basic d’Fheidhmchláir fhuinneog, sa popped amach Tagairtí-Tionscadal1 bosca dialóige, seiceáil Leabharlann Réada Microsoft Word rogha ón Tagairtí atá ar Fáil bosca liosta, féach an scáileán:

5. Cliceáil OK chun an bosca dialóige a fhágáil, ansin ba chóir duit an cnaipe macra a chur isteach sa Barra Uirlisí Rochtana Tapa. Sa nua Teachtaireacht fuinneog, roghnaigh Tuilleadh Orduithe ó na Saincheap Barra Uirlisí Rochtana Tapa titim anuas, féach ar an scáileán:

6. Sa an Roghanna Outlook bosca dialóige, déan na hoibríochtaí seo a leanas:

(1.) Roghnaigh Macraí ó na Roghnaigh orduithe ó liosta anuas;

(2.) Cliceáil an macra-ainm atá curtha isteach agat díreach anois;

(3.) Agus ansin cliceáil Cuir cnaipe chun an macra a chur isteach sa Saincheap Barra Uirlisí Rochtana Tapa.

7. Ansin cliceáil OK chun an bosca dialóige a dhúnadh, anois, tá an cnaipe macra curtha isteach sa Barra Uirlisí Rochtana Tapa, féach ar an scáileán:

8. Anois, nuair a chruthaíonn tú teachtaireacht nua, agus nuair a chliceálann tú an macra-chnaipe, cuirfear na hainmneacha iatáin os cionn chorp na teachtaireachta mar a leanas an pictiúr a thaispeántar:


Liostaigh gach ainm ceangail i gcorp na teachtaireachta agus tú ag cumadh ríomhphoist le gné shimplí

B’fhéidir go bhfuil sé deacair duit an cód thuas a chur i bhfeidhm, má tá Kutools le haghaidh Outlook, Lena Cóipeáil Ainmneacha gné, is féidir leat ainmneacha iatáin teachtaireachta a chóipeáil go tapa agus iad a ghreamú áit ar bith a theastaíonn uait.

Nóta:Chun é seo a chur i bhfeidhm Cóipeáil Ainmneacha, ar dtús, ba cheart duit an Kutools le haghaidh Outlook, agus ansin an ghné a chur i bhfeidhm go tapa agus go héasca.

Tar éis a shuiteáil Kutools le haghaidh Outlook, déan mar seo le do thoil:

1. Ar dtús, cruthaigh an ríomhphost nua atá uait le do thoil, agus ansin cliceáil Kutools > Cóipeáil Ainmneacha sa nua Teachtaireacht fuinneog, féach an scáileán:

2. Agus ansin, tiocfaidh bosca pras amach le cur i gcuimhne duit gur cóipeáladh ainmneacha na gceangal leis an gearrthaisce, féach an scáileán:

3. Anois, ní gá duit ach brú Ctrl + V eochracha le chéile chun ainmneacha na gceangal a ghreamú den chorp teachtaireachta atá uait, féach an scáileán:


Earraí níos coibhneasta:

  • Freagair Gach Le Ceangaltáin Bhunaidh In Outlook
  • De ghnáth, nuair a chuireann tú an fheidhm Freagra Uile i bhfeidhm chun an teachtaireacht a fhreagairt do gach faighteoir in Outlook, caillfear na ceangaltáin bhunaidh go huathoibríoch. An féidir ceangaltáin bhunaidh a cheangal nuair a thugtar freagra ar gach ceann in Outlook?
  • Íoslódáil / Sábháil Ceangaltáin Ó Ionchas go Fillteán Áirithe
  • Go ginearálta, is féidir leat gach ceangaltán de r-phost amháin a shábháil trí chliceáil ar Aguisíní> Sábháil Gach Ceangaltán in Outlook. Ach, más gá duit gach ceangaltán a shábháil ó gach ríomhphost a fuarthas agus ríomhphoist a fháil, an bhfuil aon idéalach? Tabharfaidh an t-alt seo dhá réiteach isteach chun ceangaltáin ó Outlook a íoslódáil go huathoibríoch chuig fillteán áirithe.
  • Athraigh Suíomh Sábháil Ceangaltán Réamhshocraithe In Outlook
  • An bhfuil tú bréan de bheith ag aimsiú an áit cheangail a shonraigh tú gach uair agus tú ag seoladh Outlook? Sa rang teagaisc seo, taispeánfaimid duit conas an suíomh réamhshocraithe astaithe a athrú. Ina dhiaidh sin, osclófar an fillteán sonraithe um shábháil ceangaltán go huathoibríoch gach uair a shábhálfaidh tú na ceangaltáin cé go n-atosóidh tú an Outlook.
  • Bain Gach Ceangaltán Ón R-phost In Outlook
  • De ghnáth nuair a bhíonn tú ag réamhamharc ar r-phost, is féidir leat ceangaltán a scriosadh le cliceáil ar dheis agus an mhír Bain Ceangaltán a roghnú. Uaireanta d’fhéadfadh go mbeadh go leor ceangaltán i dteachtaireacht ríomhphoist, agus beidh sé slachtmhar iad a bhaint ceann ar cheann. Anseo socraímid dhá chleas éasca duit gach ceangaltán a bhaint in aon ríomhphost amháin, agus gach ceangaltán a bhaint ó iliomad ríomhphoist chomh maith in Outlook.

Uirlisí Táirgiúlachta Oifige is Fearr

Kutools le haghaidh Outlook - Níos mó ná 100 Gnéithe cumhachtacha chun do Outlook a shárú

🤖 Cúntóir Ríomhphoist AI: Ríomhphoist pro toirt le draíocht AI - aon-cliceáil chun freagraí genius, ton foirfe, máistreacht ilteangach. Trasfhoirmigh ríomhphost gan stró! ...

📧 Uathoibriú Ríomhphoist: As Oifig (Ar fáil do POP agus IMAP)  /  Sceideal Seol Ríomhphoist  /  Auto CC/BCC de réir Rialacha Agus Ríomhphost á Sheoladh  /  Auto Ar Aghaidh (Ardrialacha)   /  Beannacht Auto Cuir leis   /  Scoilt Ríomhphoist Ilfhaighteoirí go huathoibríoch i dTeachtaireachtaí Aonair ...

📨 Bainistíocht Ríomhphost: Ríomhphoist a Athghairm go héasca  /  Bloc Ríomhphoist Scam ag Ábhair agus Daoine Eile  /  Scrios Ríomhphoist Dúblacha  /  Cuardach Casta  /  Comhdhlúthaigh Fillteáin ...

📁 Ceangaltáin ProSábháil Baisc  /  Baisc Dícheangail  /  Comhbhrú Baisc  /  Auto Sábháil   /  Auto Dícheangail  /  Comhbhrúite Auto ...

🌟 Draíocht Chomhéadain: 😊Níos mó Emojis Pretty and Cool   /  Treisiú Do Tháirgiúlacht Outlook le Radhairc Tabbed  /  Íoslaghdaigh Outlook In ionad Deiridh ...

???? Wonders aon-cliceáil: Freagair Gach Duine le Ceangaltáin Isteach  /   Ríomhphoist Frith-Iascaireachta  /  🕘 Taispeáin Crios Ama an tSeoltóra ...

👩🏼‍🤝‍👩🏻 Teagmhálaithe & Féilire: Baisc Cuir Teagmhálacha Ó Ríomhphoist Roghnaithe  /  Roinn Grúpa Teagmhála ar Ghrúpaí Aonair  /  Bain Meabhrúcháin Breithlá ...

Thar Gnéithe 100 Fan le do Thaiscéalaíocht! Cliceáil Anseo le Tuilleadh Amach.

 

 

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