Skip i'r prif gynnwys

Sut i greu tasg yn awtomatig wrth anfon e-bost yn Outlook?

Weithiau, efallai y bydd angen i chi greu tasg o e-bost yn awtomatig wrth ei anfon yn Outlook. Yma rydym yn darparu dull i chi ei gyflawni'n gyflym.

Auto creu tasg wrth anfon e-bost yn Outlook gyda VBA


Auto creu tasg wrth anfon e-bost yn Outlook gyda VBA

Gyda'r cod VBA isod, gallwch greu tasg yn awtomatig yn seiliedig ar e-bost anfon yn Outlook. Gwnewch fel a ganlyn.

1. Lansio eich Rhagolwg, pwyswch y Alt + F11 allweddi i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Yn y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, copïwch y cod VBA isod i'r SesiwnOutlook ffenestr cod.

Cod VBA: Auto creu tasg wrth anfon e-bost yn Outlook

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
'Updated by Extendoffice 20181123
    Dim xYesNo As Integer
    Dim xPrompt As String
    Dim xTaskItem As TaskItem
    Dim xRecipient As String
    On Error Resume Next
    xPrompt = "Do you want to create a task for this message?"
    xYesNo = MsgBox(xPrompt, vbYesNo + vbInformation, "Kutools for Outlook")
    Cancel = False
    If xYesNo = vbNo Then Exit Sub
    Set xTaskItem = Application.CreateItem(olTaskItem)
    For Each Rcp In Item.Recipients
        If xRecipient = "" Then
            xRecipient = Rcp.Address
        Else
            xRecipient = xRecipient & vbCrLf & Rcp.Address
        End If
    Next Rcp
    xRecipient = xRecipient & vbCrLf & Item.Body
    With xTaskItem
        .Subject = Item.Subject
        .StartDate = Item.ReceivedTime
        .DueDate = Date + 3 + CDate("9:00:00 AM")
        .ReminderSet = True
        .ReminderTime = Date + 2 + CDate("9:00:00 AM")
        .Body = xRecipient
        .Save
    End With
    Set xTaskItem = Nothing
End Sub

Nodyn: Bydd y rhai sy'n derbyn negeseuon a'r corff negeseuon yn cael eu hychwanegu at y corff tasg yn awtomatig. Dyddiad cychwyn y dasg yw dyddiad anfon y neges, a bydd y dasg yn ddyledus mewn 3 diwrnod. Fe'ch atgoffir o'r dasg am 9 am ar ôl un diwrnod. Gallwch eu newid yn ôl yr angen.

3. Cadwch y cod a gwasgwch y Alt + Q allweddi i gau ffenestr Microsoft Visual Basic for Applications.

4. O hyn ymlaen, wrth glicio ar y anfon botwm mewn ffenestr e-bost newydd neu wedi'i hateb, a Creu Tasg bydd blwch deialog yn ymddangos fel y dangosir isod y llun, cliciwch Ydy i anfon yr e-bost a chreu tasg yn awtomatig, neu glicio Na i anfon yr e-bost heb greu tasg.


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

This worked for a few days and now it no longer works.

Is there a reason?
This comment was minimized by the moderator on the site
Hi Terri Amos,
Please enable the Enable all macros option and the Apply macro security settings to installed add-ins option as shown in the screenshot below. After that, restart your Outlook.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/task.png
This comment was minimized by the moderator on the site
Is there a way to modify this as to include more of a link to the sent mail than just recipients & subject? ie. add the sent mail as attachment?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations