Skip i'r prif gynnwys

Sut i ateb pob un gydag atodiadau gwreiddiol yn Outlook?

Awdur: Xiaoyang Wedi'i Addasu Diwethaf: 2020-05-29

Fel rheol, pan ddefnyddiwch y swyddogaeth Ateb Pawb i ateb y neges i'r holl dderbynwyr yn Outlook, collir yr atodiadau gwreiddiol yn awtomatig. A yw'n bosibl atodi atodiadau gwreiddiol wrth ateb pawb yn Outlook?

Atebwch bob un gydag atodiadau gwreiddiol gyda chod VBA

Atebwch bob un ag atodiadau gwreiddiol gyda Kutools ar gyfer Outlook


Atebwch bob un gydag atodiadau gwreiddiol gyda chod VBA

Nid oes unrhyw nodwedd uniongyrchol i ddelio â'r dasg hon yn Outlook, ond, gallwch gymhwyso'r cod VBA canlynol i'w gyflawni. Gwnewch y camau isod: Os gwelwch yn dda:

1. Lansio'r Rhagolwg, ac yna dal i lawr y ALT + F11 allweddi i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Yn y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, cliciwch ddwywaith SesiwnOutlook oddi wrth y Prosiect1 (VbaProject.OTM) cwarel i agor y modd, ac yna copïo a gludo'r cod canlynol i'r modiwl gwag.

Cod VBA: Atebwch bob un ag ahhachments gwreiddiol:

Sub ReplyAllWithAttachments()
'Updateby Extendoffice
Dim xItem As Object
On Error Resume Next
Select Case TypeName(Outlook.Application.ActiveWindow)
Case "Explorer"
For Each xItem In Outlook.Application.ActiveExplorer.Selection
GetReplyItem xItem
Next
Case "Inspector"
Set xItem = Outlook.Application.ActiveInspector.CurrentItem
GetReplyItem xItem
End Select
Set xItem = Nothing
End Sub
Sub GetReplyItem(Item As Object)
Dim xReplyMailItem As Outlook.MailItem
On Error Resume Next
If Not Item Is Nothing Then
Set xReplyMailItem = Item.ReplyAll
GetAttachments Item, xReplyMailItem
xReplyMailItem.Display
'xReplyMailItem.Send
Item.UnRead = False
End If
Set xReplyMailItem = Nothing
End Sub
Sub GetAttachments(xSourceItem, xTargetItem)
Dim xFSO As Scripting.FileSystemObject
Dim xTmpPath As String
Dim xAttachment As Attachment
Dim xTmpFile As String
On Error Resume Next
Set xFSO = New Scripting.FileSystemObject
xTmpPath = CreateObject("shell.Application").NameSpace(5).self.Path & "\TmpAttachments\"
If xFSO.FolderExists(xTmpPath) = False Then
MkDir xTmpPath
End If
For Each xAttachment In xSourceItem.Attachments
If IsEmbeddedAttachment(xAttachment) = False Then
xTmpFile = xTmpPath & xAttachment.FileName
xAttachment.SaveAsFile xTmpFile
xTargetItem.Attachments.Add xTmpFile, , , xAttachment.DisplayName
xFSO.DeleteFile xTmpFile
End If
Next
If xFSO.FolderExists(xTmpPath) Then
Kill xTmpPath
End If
Set xFSO = 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

doc ateb i gyd gydag atodiad 1

3. Ac yna cliciwch offer > Cyfeiriadau yn y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, yn y popped allan Cyfeiriadau-Prosiect1 blwch deialog, gwirio Amser Rhedeg Sgriptio Microsoft opsiwn gan y Cyfeiriadau sydd ar Gael blwch rhestr, gweler y screenshot:

doc ateb i gyd gydag atodiad 9

4. Yna arbedwch a chau ffenestr y cod, ac yna gallwch chi ychwanegu'r botwm macro i mewn i'r Bar Offer Mynediad Cyflym.

5. Agorwch yr e-bost rydych chi am ei ateb i gyd gydag atodiad ynddo Neges ffenestr, yna dewiswch Mwy o Orchmynion oddi wrth y Addasu Bar Offer Mynediad Cyflym gwympo, gweler y screenshot:

doc ateb i gyd gydag atodiad 2

6. Yn y Dewisiadau Outlook blwch deialog, gwnewch y gweithrediadau canlynol:

(1.) Dewis Macros oddi wrth y Dewiswch orchmynion oddi wrth rhestr ostwng;

(2.) Cliciwch yr enw macro rydych wedi'i fewnosod dim ond nawr;

(3.) Ac yna cliciwch Ychwanegu botwm i ychwanegu'r macro i mewn i'r Addasu Bar Offer Mynediad Cyflym.

doc ateb i gyd gydag atodiad 3

7. Yna cliciwch OK i gau'r blwch deialog, nawr, mae'r botwm macro wedi'i fewnosod yn y Bar Offer Mynediad Cyflym, gweler y screenshot:

doc ateb i gyd gydag atodiad 4

8. Nawr, cliciwch y botwm macro, ac mae'r ffenestr ateb ateb gydag atodiadau gwreiddiol yn cael ei hagor, yna cyfansoddi'r neges ateb, a chlicio anfon botwm, gweler y screenshot:

doc ateb i gyd gydag atodiad 5


Atebwch bob un ag atodiadau gwreiddiol gyda Kutools ar gyfer Outlook

Os oes gennych Kutools ar gyfer Rhagolwg, Gyda'i Ateb Pawb gydag Atodiad nodwedd, gallwch ateb pob un gydag atodiadau dim ond un clic.

Kutools ar gyfer Rhagolwg : gyda mwy na 100 o ychwanegiadau defnyddiol Outlook, yn rhad ac am ddim i geisio heb unrhyw gyfyngiad mewn 60 diwrnod. 

Ar ôl gosod Kutools ar gyfer Rhagolwg, gwnewch fel hyn:

1. Dewiswch y neges eich bod am ateb pob un gydag atodiadau, ac yna cliciwch Kutools > Ymateb gydag Atodiad > Ateb Pawb gydag Atodiad, gweler y screenshot:

2. Ac mae'r ffenestr neges ateb yn cael ei hagor gydag atodiadau gwreiddiol, yna cyfansoddi'ch neges a'i hanfon, gweler y screenshot:

doc ateb i gyd gydag atodiad 7

Cliciwch i lawrlwytho Kutools ar gyfer Outlook a threial am ddim nawr!


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 (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Is it possible that, after a reboot or windows update, the macro is not working anymore? Also after doing again the procedure is not working anymore
This comment was minimized by the moderator on the site
Bonjour, la macro n'a fonctionné qu'une seule fois, dommage
This comment was minimized by the moderator on the site
Bonjour, nickel, mais n'a fonctionné qu'une fois. dommage
This comment was minimized by the moderator on the site
BonjourCette macros est super malheureusement cela ne fonctionne qu'une fois.. dommage
This comment was minimized by the moderator on the site
is there a macro that replies to all keeps attachments and keeps the original email in text format?
This comment was minimized by the moderator on the site
Thank you very much, you are the only one to share this macro and it's awesome, thank you for your work !
This comment was minimized by the moderator on the site
a macro VBA só funciona por um dia?
This comment was minimized by the moderator on the site
Bonjour,


Super, ça marche à merveille. J'ai visité plein de tuto et d'échange sur le sujet et aucune réponse satisfaisante avant celui-ci. Sachant que jusqu'à présent, je bricolais toujours entre "transférer" et remettre les destinataires ou "répondre à tous" et remettre la ou les pièces jointes. Encore merci.

Harivola
This comment was minimized by the moderator on the site
All files in mail adding as attachment such as image in my signiture.
How can i only attachment files
This comment was minimized by the moderator on the site
Hi,
If you need to exclude the images within the messages which are inserted into the attachments, please apply the below VBA code, hope it can help you!
Sub ReplyAllWithAttachments()
Dim xItem As Object
On Error Resume Next
Select Case TypeName(Outlook.Application.ActiveWindow)
Case "Explorer"
For Each xItem In Outlook.Application.ActiveExplorer.Selection
GetReplyItem xItem
Next
Case "Inspector"
Set xItem = Outlook.Application.ActiveInspector.CurrentItem
GetReplyItem xItem
End Select
Set xItem = Nothing
End Sub
Sub GetReplyItem(Item As Object)
Dim xReplyMailItem As Outlook.MailItem
On Error Resume Next
If Not Item Is Nothing Then
Set xReplyMailItem = Item.ReplyAll
GetAttachments Item, xReplyMailItem
xReplyMailItem.Display
'xReplyMailItem.Send
Item.UnRead = False
End If
Set xReplyMailItem = Nothing
End Sub
Sub GetAttachments(xSourceItem, xTargetItem)
Dim xFSO As Scripting.FileSystemObject
Dim xTmpPath As String
Dim xAttachment As Attachment
Dim xTmpFile As String
On Error Resume Next
Set xFSO = New Scripting.FileSystemObject
xTmpPath = CreateObject("shell.Application").NameSpace(5).self.Path & "\TmpAttachments\"
If xFSO.FolderExists(xTmpPath) = False Then
MkDir xTmpPath
End If
For Each xAttachment In xSourceItem.Attachments
If IsEmbeddedAttachment(xAttachment) = False Then
xTmpFile = xTmpPath & xAttachment.FileName
xAttachment.SaveAsFile xTmpFile
xTargetItem.Attachments.Add xTmpFile, , , xAttachment.DisplayName
xFSO.DeleteFile xTmpFile
End If
Next
If xFSO.FolderExists(xTmpPath) Then
Kill xTmpPath
End If
Set xFSO = 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
This comment was minimized by the moderator on the site
I signed up just to say thank you! Skyyang.
This comment was minimized by the moderator on the site
Thanks alot
This comment was minimized by the moderator on the site
Getting compile error as : User-define type not defined at line no " Dim xFSO As Scripting.FileSystemObject" under "Sub GetAttachments(xSourceItem, xTargetItem)"
Kindly Advice on this error.
This comment was minimized by the moderator on the site
Hello, Sam,
Sorry, the article misses the step 3, I have updated this article, please try again. Hope it can help you!

Thank you for your reminder.
This comment was minimized by the moderator on the site
Thank you so much skyyang!!

Works like a charm.

Best Regards
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations