Skip i'r prif gynnwys

Sut i ychwanegu cysylltiadau o e-bost yn awtomatig wrth ateb yn Outlook?

Yn Outlook 2010 gallwch chi alluogi'r Cysylltiadau a awgrymir nodweddu ac ychwanegu derbynwyr yn awtomatig fel cysylltiadau newydd. Fodd bynnag, hyn Cysylltiadau a awgrymir ni chefnogir nodwedd yn Outlook 2013 a 2016. Yma, byddaf yn cyflwyno VBA i ychwanegu anfonwr a derbynwyr e-bost yn awtomatig fel cysylltiadau newydd wrth ateb yn Outlook.

Auto ychwanegu cysylltiadau o e-bost Outlook wrth ateb gyda VBA

Tab Office - Galluogi Golygu a Phori Tabiau yn Microsoft Office, Gwneud Gwaith yn Awel
Kutools ar gyfer Outlook - Hwb Outlook gyda 100 + Nodweddion Uwch ar gyfer Effeithlonrwydd Superior
Rhowch hwb i'ch Outlook 2021 - 2010 neu Outlook 365 gyda'r nodweddion uwch hyn. Mwynhewch dreial cynhwysfawr am ddim 60 diwrnod a dyrchafwch eich profiad e-bost!

Auto ychwanegu cysylltiadau o e-bost Outlook wrth ateb gyda VBA

Bydd y VBA hwn yn ychwanegu anfonwr a holl dderbynwyr e-bost yn awtomatig fel cysylltiadau newydd pan fyddwch yn ateb yr e-bost yn Outlook. Gwnewch fel a ganlyn:

1. Gwasgwch Alt + F11 allweddi i agor ffenestr Microsoft Visual Basic for Applications.

2. Ehangu'r Project1, a chlicio ddwywaith SesiwnOutlook i'w agor, ac yna pastiwch islaw cod VBA i mewn i ffenestr ThisOutlookSession. Gweler y screenshot:

VBA: Auto Ychwanegu Cysylltiadau o e-bost wrth ateb yn Outlook

Public WithEvents xExplorer As Outlook.Explorer
Public WithEvents xMailItem As Outlook.MailItem
Sub Application_Startup()
Set xExplorer = Outlook.Application.ActiveExplorer
End Sub

Private Sub xExplorer_SelectionChange()
On Error Resume Next
Set xMailItem = xExplorer.Selection.Item(1)
End Sub

Private Sub xMailItem_Reply(ByVal Response As Object, Cancel As Boolean)
Dim xNameSpace As NameSpace
Dim xSenderAddress As String
Dim xContactItems As Outlook.Items
Dim i, k As Long
Dim xFilterAddress As String
Dim xContact As Outlook.ContactItem
Dim xNewContact As Outlook.ContactItem
Dim Arr() As String
Dim ArrName() As String
Dim xArrCount As Integer
On Error Resume Next
ReDim Arr(xMailItem.Recipients.Count + 1)
ReDim ArrName(xMailItem.Recipients.Count + 1)
xSenderAddress = xMailItem.SenderEmailAddress
Arr(0) = xSenderAddress
ArrName(0) = xMailItem.SenderName
For i = LBound(Arr) + 1 To UBound(Arr) - 1
Arr(i) = xMailItem.Recipients.Item(i).Address
ArrName(i) = xMailItem.Recipients.Item(i).Name
Next i
Set xNameSpace = Outlook.Application.GetNamespace("MAPI")
Set xContactItems = xNameSpace.GetDefaultFolder(olFolderContacts).Items
For i = LBound(Arr) To UBound(Arr) - 1
For k = 1 To 3
xFilterAddress = "[Email" & k & "Address] = " & Arr(i)
Set xContact = xContactItems.Find(xFilterAddress)
If Not (xContact Is Nothing) Then
Exit For
End If
Next k
If xContact Is Nothing Then
Set xNewContact = Outlook.Application.CreateItem(olContactItem)
With xNewContact
.FullName = ArrName(i)
.Email1Address = Arr(i)
.Categories = "From Email"
.Save
End With
End If
Next i
End Sub

3. Cadwch y cod VBA, ac ailgychwynwch eich Microsoft Outlook.

O hyn ymlaen, pan fyddwch chi'n ateb e-bost yn Outlook, bydd anfonwr yr e-bost hwn a'r holl dderbynwyr yn cael eu cadw fel cysylltiadau newydd yn awtomatig i ffolder cyswllt diofyn y cyfrif e-bost diofyn.


Erthyglau Perthnasol


Offer Cynhyrchiant Swyddfa Gorau

Kutools ar gyfer Rhagolwg - Dros 100 o Nodweddion Pwerus i Werthu Eich Outlook

🤖 Cynorthwy-ydd Post AI: E-byst pro ar unwaith gyda hud AI - un clic i atebion athrylith, tôn berffaith, meistrolaeth amlieithog. Trawsnewid e-bostio yn ddiymdrech! ...

📧 E-bostio Automation: Allan o'r Swyddfa (Ar gael ar gyfer POP ac IMAP)  /  Amserlen Anfon E-byst  /  Auto CC/BCC gan Reolau Wrth Anfon E-bost  /  Awto Ymlaen (Rheolau Uwch)   /  Auto Ychwanegu Cyfarchiad   /  Rhannwch E-byst Aml-Dderbynnydd yn Negeseuon Unigol yn Awtomatig ...

📨 Rheoli E-bost: Dwyn i gof E-byst yn Hawdd  /  Rhwystro E-byst Sgam gan Bynciau ac Eraill  /  Dileu E-byst Dyblyg  /  Chwilio Manwl  /  Cydgrynhoi Ffolderi ...

📁 Ymlyniadau ProArbed Swp  /  Swp Datgysylltu  /  Cywasgu Swp  /  Auto Achub   /  Datgysylltiad Auto  /  Cywasgiad Auto ...

🌟 Rhyngwyneb Hud: 😊Mwy o Emojis Pretty a Cŵl   /  Rhowch hwb i'ch Cynhyrchiant Outlook gyda Golygfeydd Tabbed  /  Lleihau Outlook Yn lle Cau ...

???? Rhyfeddodau un clic: Ateb Pawb ag Ymlyniadau Dod i Mewn  /   E-byst Gwrth-Gwe-rwydo  /  🕘Dangos Parth Amser yr Anfonwr ...

👩🏼‍🤝‍👩🏻 Cysylltiadau a Chalendr: Swp Ychwanegu Cysylltiadau O E-byst Dethol  /  Rhannwch Grŵp Cyswllt i Grwpiau Unigol  /  Dileu Atgoffa Pen-blwydd ...

Dros Nodweddion 100 Aros Eich Archwiliad! Cliciwch Yma i Ddarganfod Mwy.

 

 

Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello, thank you for this code.
But it duplicates (in my case at least) the contacts as many times as I write to them. Any idea?
By the way, in outlook options, the box "search for duplicates when saving a new contact" is checked.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations