Skip to main content

Conas freagra uathoibríoch a thabhairt leis an teachtaireacht ríomhphoist bhunaidh in Outlook?

De ghnáth, nuair a chruthaímid riail chun an ríomhphost a chur as oifig go huathoibríoch, ach ní áireofar an teachtaireacht bhunaidh i gcorp. Conas a d’fhéadfá brath go huathoibríoch ar na ríomhphoist le teachtaireacht bhunaidh in Outlook? An t-alt seo, labhróidh mé faoi chód VBA chun cabhrú leat an post seo a chríochnú chomh tapa agus is féidir in Outlook.

Ríomhphoist freagartha uathoibríoch le teachtaireacht bhunaidh i bhfianaise an chóid VBA


Ríomhphoist freagartha uathoibríoch le teachtaireacht bhunaidh i bhfianaise an chóid VBA

Ní féidir le gnáthriail Outlook cabhrú leat déileáil le post, ach, leis an gcód VBA seo a leanas, is féidir leat é seo a chríochnú go tapa agus go héasca. Déan mar seo le do thoil:

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 ón 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: Ríomhphoist freagartha uathoibríoch leis an teachtaireacht bhunaidh:

Public WithEvents xlItems As Outlook.Items
Private Sub Application_Startup()
    Set xlItems = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub xlItems_ItemAdd(ByVal objItem As Object)
Dim xlReply As MailItem
Dim xStr As String
If objItem.Class <> olMail Then Exit Sub
Set xlReply = objItem.Reply
With xlReply
     xStr = "<p>" & "Hi, Your email has been received. Thank you!" & "</p>"
     .HTMLBody = xStr & .HTMLBody
     .Send
End With
End Sub 

3. Ansin sábháil agus dún fuinneog an chóid, déan an Outlook a dhúnadh nó a atosú chun go mbeidh an cód VBA i bhfeidhm. Anois, nuair a gheobhaidh tú ríomhphoist, seolfaidh Outlook freagra uathoibríoch leis an teachtaireacht bhunaidh mar a thaispeántar an scáileán a leanas:


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 (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello

I have another question. How can I change the Session.GetDefaultFolder(olFolderInbox).Items. I work with several email accounts and I need this response just from 3 of them.

Thank you in advance
This comment was minimized by the moderator on the site
Hi,
I have another question:
How do I apply this rule to a specific selected sender only
Session.GetDefaultFolder(olFolderInbox).Items
This comment was minimized by the moderator on the site
HiI have the same question : how do I apply this rule to selected sender only ?br
This comment was minimized by the moderator on the site
Hello, Damien,For specifying some senders when auto reply, please apply the below code:

<div data-tag="code">Public WithEvents xlItems As Outlook.Items
Private Sub Application_Startup()
Set xlItems = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub xlItems_ItemAdd(ByVal objItem As Object)
Dim xlReply As MailItem
Dim xStr As String
Dim xSenderAddr As String
On Error Resume Next
If objItem.Class <> olMail Then Exit Sub
xSenderAddr = "," 'type your own sender emials here, separate them by commas.
If objItem.Sender.Type = "EX" Then
If InStr(xSenderAddr, objItem.Sender.GetExchangeUser.PrimarySmtpAddress) = 0 Then Exit Sub
Else
If InStr(xSenderAddr, objItem.Sender.Address) = 0 Then Exit Sub
End If
Set xlReply = objItem.Reply
With xlReply
xStr = "<p>" & "Hi, Your email has been received. Thank you!" & "</p>"
.HTMLBody = xStr & .HTMLBody
.Send
End With
End SubPlease try, hope it can help you!
This comment was minimized by the moderator on the site
Hi , I've try this , but wouldn't work (:
This comment was minimized by the moderator on the site
How can you modify this to only run if there is a keyword in the message of the body?
This comment was minimized by the moderator on the site
I have the same question, did you figure it out?
This comment was minimized by the moderator on the site
try thisDim olMail As object
If (olMail.Subject Like "*Place_Keyword_here(Leave_doublequotes_and_asteriscs)*") Then
CodeEnd if
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations